if (FALSE) {
## load and prepare data
data("winddata", package="bReeze")
set40 <- set(height=40, v.avg=winddata[,2], v.max=winddata[,3])
set30 <- set(height=30, v.avg=winddata[,6], v.max=winddata[,7])
set20 <- set(height=20, v.avg=winddata[,10])
ts <- timestamp(timestamp=winddata[,1])
neubuerg <- mast(timestamp=ts, set40, set30, set20)
neubuerg <- clean(mast=neubuerg)
## calculate monthly means
neubuerg.stats <- month.stats(mast=neubuerg) # default
month.stats(mast=neubuerg, set=1) # one dataset
month.stats(mast=neubuerg, set="set1") # same as above
month.stats(mast=neubuerg, signal="v.max") # change signal
# calculate monthly median, min, max and standard deviation
month.stats(mast=neubuerg, fun="median")
month.stats(mast=neubuerg, fun="min")
month.stats(mast=neubuerg, fun="max")
month.stats(mast=neubuerg, fun="sd")
# data subsets
month.stats(mast=neubuerg,
subset=c("2009-12-01 00:10:00", "2009-12-31 23:50:00"))
month.stats(mast=neubuerg,
subset=c("2010-01-01 00:10:00", NA)) # just 'start' time stamp
month.stats(mast=neubuerg,
subset=c(NA, "2009-12-31 23:50:00")) # just 'end' time stamp
month.stats(mast=neubuerg, digits=2) # change number of digits
neubuerg.ms <- month.stats(mast=neubuerg, print=FALSE) # hide results
neubuerg.ms
## plot month stats object
plot(neubuerg.ms) # default
plot(neubuerg.ms, set=1) # one dataset
plot(neubuerg.ms, set="set1") # same as above
# customize plot
plot(neubuerg.ms, border="darkgray", bty="l", cex.axis=0.7,
cex.lab=0.9, col=c(gray(0.3), gray(0.7)), col.axis="darkgray",
col.box="darkgray", col.lab="darkgray", col.ticks="darkgray", las=0,
legend=FALSE, mgp=c(2, 0.7, 0), plot.names=FALSE, ylim=c(0,7),
ylab="Wind speed [m/s]")
}
Run the code above in your browser using DataLab