Agg {EmiStatR}R Documentation

Temporal aggregation of environmental variables

Description

Function for temporal aggregation of environmental variables. Agg is a wrapper function of aggregate from stats package.

Usage

  Agg(data, nameData, delta, func, namePlot)

Arguments

data

A data.frame that contains the time series of the environmental variable to be aggregated, e.g. precipitation. This data.frame should have at least two columns: the first one, Time [y-m-d h:m:s]; the second one, a numeric value equal to the magnitude of the environmental variable. If the environmental variable is different than precipitation, then the column name of the values should be named as value.

nameData

A character string that defines the name of the environmental variable to be aggregated.

delta

A numeric value that specifies the level of aggregation required in minutes.

func

The name of the function of aggregation e.g. mean, sum.

namePlot

A character string that defines the title of the plot generated. Use "" to avoid writing the plot locally.

Value

A data.frame with two columns:

time

the date-time time series of the aggregated variable

value

time series with the magnitude of the aggregated variable.

Author(s)

J.A. Torres-Matallana

Examples


## temporal aggregation
library(EmiStatR)
data(P1)
colnames(P1) <- c("time", "value")
head(P1)
tail(P1)

P1.agg <- Agg(data = P1, nameData = "value", delta = 120 , func = sum, 
              namePlot = "")

head(P1.agg)
tail(P1.agg)



[Package EmiStatR version 1.2.3.0 Index]