aggregate: aggregate

aggregate.smetR Documentation

aggregate

Description

aggregate

Usage

## S3 method for class 'smet'
aggregate(
  x,
  date.field = "timestamp",
  FUN = mean,
  INDEX = by[1],
  by = c("hourly", "daily", "monthly", "yearly"),
  past = TRUE,
  ...
)

Arguments

x

a smet-class object

date.field

field name used for date and time. Default is "timestamp", as used for SMET format.

INDEX, FUN, ...

further arguments for tapply

by

an index vector or a chararacter vector defining the time interval used for aggregation. Default is c("hourly","daily","monthly","yearly"), it can be one of these character values, in case of vectore with caracheter values. only the first element is considered.

past

logical value. If it is TRUE aggregation value is referenced to the time step before the date.field (e.g. "timestamp" instant value, otherwise it is referenced to the timestep after the date.field value.

Details

FUN can be one function or a list of functions where each function is used to aggregate each time-series variable of the smet-class object object. In case FUN is a list , each function element should be named with the respectiva variable name and all functions must have the seme arguments passed through ... .

See Also

as.smet,tapply

Examples

smet <- as.smet(system.file("examples/T0179.smet",package="RSMET"))

out <- aggregate(smet)
out_d <- aggregate(smet,by="daily",past=FALSE)


ecor/RSMET documentation built on Aug. 30, 2023, 2:04 a.m.