YearMean: Calculate annual means from data.table

Description Usage Arguments Value Examples

View source: R/YearMean.R

Description

Calculate annual means from data.table

Usage

1
YearMean(data, varname = "value", na.rm = TRUE)

Arguments

data

data table containing the columns date (Date object) and value (the variable)

varname

name of the variable, defaults to 'valueā€¯

na.rm

a logical value indicating whether 'NA' values should be stripped before the computation proceeds. Defaults to TRUE

Value

data table with annual mean values.

Examples

1
2
3
4
5
 mydata <- data.frame(date = seq.Date(as.Date('1990-01-01'),
                                  as.Date('2000-12-31'),
                                  by = '1 months'),
                                  value = rnorm(11*12))
YearMean(mydata,)

smu/smumisc documentation built on March 21, 2021, 3:38 a.m.