aggregate.station: aggregate

View source: R/aggregate.R

aggregate.stationR Documentation

aggregate

Description

The aggregation functions are based on the S3 method for zoo objects, but takes care of extra house keeping, such as attributes with meta data.

Usage

## S3 method for class 'station'
aggregate(
  x,
  by,
  FUN = "mean",
  ...,
  na.rm = TRUE,
  regular = NULL,
  frequency = NULL,
  verbose = FALSE,
  threshold = 1
)

Arguments

x

A station object

by

see aggregate.zoo

FUN

a function; see aggregate.zoo. Additional options: 'area','exceedance','lessthan'.

...

additional arguments

na.rm

TRUE: ignore NA - see see mean

regular

see aggregate.zoo

frequency

see aggregate.zoo

verbose

if TRUE print progress

threshold

threshold used if FUN is 'count', 'freq', 'wetfreq', or 'wetmean'

Details

aggregate calculates a time aggregate of an input object, e.g, the mean seasonal cycle (if by=month and FUN="mean") or the annual sum (if by=year and FUN="sum").

aggregate.area is used for aggregating spatial statistics, such as the global mean or the global area of some phenomenon. aggregate.size is similar to aggregate.area, but returns the size statistics (square meters) for individual events (defined as gridboxes touching each other).

Value

The call returns a station object

Author(s)

R.E. Benestad

See Also

aggregate.area aggregate.size

Examples


## S3 method for class 'station'
data(Svalbard)
x <- aggregate(Svalbard, month, FUN='mean', na.rm=TRUE)
plot(x)

## S3 method for class 'field'
slp <- slp.DNMI()
y <- aggregate(slp, year, FUN='mean', na.rm=FALSE)



metno/esd documentation built on April 24, 2024, 9:19 p.m.