wcal-methods: Calculate weather variables through function or a string...

wcalR Documentation

Calculate weather variables through function or a string formula.

Description

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

Usage

wcal(object, ...)

## S4 method for signature '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" )

weaana documentation built on Nov. 5, 2025, 6:08 p.m.