sub-.pField: Extract or replace parts of a pField object

Description Usage Arguments Details Value Author(s) Source See Also

Description

Method for extracting or replacing a subset of a "pField" object.

Usage

1
2
## S3 method for class 'pField'
x[p1, p2, ...]

Arguments

x

a "pField" object.

p1

possible row indices for the subset: x[p1, ].

p2

possible column indices for the subset: x[, p2].

...

further arguments passed on to the generic method "["; currently not needed.

Details

For subsetting, the class of the returned object depends on the specified indices:

x[p1, ]

a "pField" object.

x[, p2]

a "pTs" object if p2 is of length 1 (single site) or if the subset is not compatible with a "pField" object (i.e. the subset sites cover more than one latitude, but, for each, do not cover the full range of longitudes).

x[p1, p2]

same as before for the time subset p1.

x[p1]

a numeric vector of length length(p1) where the time and lat-lon information are lost with a warning.

x[] or x[,]

the original object x.

Value

the original object with the replaced subset x[p1, p2], or the subset x[p1, p2]. For the latter, depending on the provided indices, this can be an object of class "pField", an object of class "pTs", or simply a numeric vector; see details.

Author(s)

Thomas Laepple; adapted by Thomas Münch

Source

Function adapted from "proxytype.R" in paleolibary/src/.

See Also

?[.pTs


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