There are two modes to use wcal, function mode if FUN is not null, and string formula mode if FUN is NULL.

wcal(object, ...)

# S4 method for WeaAna
wcal(object, FUN = NULL, ..., var.args = NULL, var.name = NULL)

Arguments

object

A WeaAna objects.

...

Optional arguments to FUN in function mode. String formulas if FUN is NULL.

FUN

A function to be used which results should have the same length as original records.

var.args

Arguments of weather variable pass to FUN.

var.name

Variable name is used if FUN is not NULL.

Examples

library(weaana)
data( "records" ) 
# Daily mean temperature
wcal( records, avgt2 = "( maxt + mint ) / 2" )
# Moving average temperature
wcal( records, FUN = mov.avg, var.args = "avgt", k = 5, shift = "begin", var.name = "mov.avg" )