aggregate.area: aggregate

View source: R/aggregate.area.R

aggregate.areaR 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 'area'
aggregate(
  x,
  ...,
  is = NULL,
  it = NULL,
  FUN = "sum",
  na.rm = TRUE,
  smallx = FALSE,
  verbose = FALSE,
  a = 6378,
  threshold = NULL
)

Arguments

x

A station object

...

additional arguments

is

A list or data.frame providing space index, see subset

it

A list or data.frame providing time index, see subset

FUN

A function, e.g., 'sum' or 'mean'

na.rm

a boolean; if TRUE ignore NA, see mean

smallx

a boolean defaulting to FALSE

verbose

a boolean; if TRUE print information about progress

a

radius of earth (unit: km)

threshold

threshold to be used if FUN is 'area','exceedance', or 'lessthan'

Details

aggregate.area is used for aggregating spatial statistics, such as the global mean or the global area of some phenomenon.

The function aggregateArea is exactly the same as aggregate.area.

Value

The call returns a station object

Author(s)

R.E. Benestad

See Also

aggregate 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)

## Aggregate area
w <- aggregate.area(y)
plot(w)


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