month.stats {bReeze}R Documentation

Calculation of monthly statistics


Calculates monthly statistics.


month.stats(mast, set, signal="v.avg", 
  fun=c("mean", "median", "min", "max", "sd"), subset, 
  digits=3, print=TRUE)
ms(mast, set, signal="v.avg", 
  fun=c("mean", "median", "min", "max", "sd"), subset, 
  digits=3, print=TRUE)

## S3 method for class 'month.stats'
plot(x, set, ...)



Met mast object created by mast.


Set used for calculation or plotting specified as set number or set name. If missing, the calculation or plotting is carried out for all datasets that contain the specified signal.


The signal to be used, as string value. Default is "v.avg".


Statistical function, as string value – one of "mean" (arithmetic mean), "median", "min" (minimum), "max" (maximum) or "sd" (standard deviation).


Optional start and end time stamp for a data subset, as string vector c(start, end). The time stamps format shall follow the rules of ISO 8601 international standard, e.g. "2012-08-08 22:55:00".


Number of decimal places to be used for results as numeric value. Default is 3.


If TRUE (the default), results are printed directly.


Monthly statistics object created by month.stats.


Arguments to be passed to methods. For optional graphical parameters see below.


month.stats calculates statistics of valid data for each month and year in the measurement period. Usually this function is used for the calculation of average wind speeds. Means strongly depend on the measurement period and the number of samples. One important requirement for a reliable wind assessment is a measurement period covering the full seasonal cycle of variations. A typical bias is a measurement limited to winter months, which usually results in overestimated wind speeds.


Returns a list of data frames (one for each dataset) containing monthly, annual and total statistics of the specified signal.

Optional graphical parameters

The following graphical parameters can optionally be added to customize the plot:


Christian Graul


Brower, M., Marcus, M., Taylor, M., Bernadett, D., Filippelli, M., Beaucage, P., Hale, E., Elsholz, K., Doane, J., Eberhard, M., Tensen, J., Ryan, D. (2010) Wind Resource Assessment Handbook.

See Also



## Not run: 
## 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
  subset=c("2009-12-01 00:10:00", "2009-12-31 23:50:00"))
  subset=c("2010-01-01 00:10:00", NA)) # just 'start' time stamp
  subset=c(NA, "2009-12-31 23:50:00")) # just 'end' time stamp

month.stats(mast=neubuerg, digits=2)  # change number of digits <- month.stats(mast=neubuerg, print=FALSE)  # hide results

## plot month stats object
plot(  # default
plot(, set=1)  # one dataset
plot(, set="set1")  # same as above

# customize plot
plot(, border="darkgray", bty="l", cex.axis=0.7, 
  cex.lab=0.9, col=c(gray(0.3), gray(0.7)), col.axis="darkgray","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]")

## End(Not run)

[Package bReeze version 0.4-3 Index]