ApplySpace: Apply a function across space

Description Usage Arguments Details Value Author(s) Source Examples

View source: R/apply-fields.R

Description

Apply a function across the spatial dimension of a "pField" or "pTs" object by using apply on the rows of the object. The result of this gives a "pTs" vector object, i.e. a single time series.

Usage

1

Arguments

data

a "pField" or "pTs" object.

FUN

the function to be applied.

...

further arguments passed on to FUN.

Details

Input columns which only contain NA values are stripped befor applying the function. If only one non-NA column is present, this column is returned unchanged with a warning.

Value

a single "pTs" time series with the results of the function applied.

Author(s)

Thomas Laepple

Source

Function copied from "basis.R" in paleolibary/src/.

Examples

1
2
3
4
5
6
x <- pField(data = array(rnorm(10 * 10 * 100), dim = c(10, 10, 100)),
            time = 1 : 100, lat = 1 : 10, lon = 1 : 10)
ApplySpace(x, sd)

x <- x[, 1 : 15]
ApplySpace(x, sd)

EarthSystemDiagnostics/pfields documentation built on Jan. 10, 2022, 10:37 p.m.