month.stats: Calculation of monthly statistics

Description Usage Arguments Details Value Optional graphical parameters Author(s) References See Also Examples

View source: R/month.stats.R

Description

Calculates monthly statistics.

Usage

1
2
3
4
5
6
7
8
9
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, ...)

Arguments

mast

Met mast object created by mast.

set

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.

signal

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

fun

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

subset

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".

digits

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

print

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

x

Monthly statistics object created by month.stats.

...

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

Details

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.

Value

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:

Author(s)

Christian Graul

References

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. http://www.renewablenrgsystems.com/TechSupport/~/media/Files/PDFs/wind_resource_handbook.ashx

See Also

mast

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
## 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
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]")

## End(Not run)

bReeze documentation built on May 2, 2019, 3:32 p.m.