Description Usage Arguments Value Author(s) Source Examples
Apply a function across the temporal dimension of a "pField"
or
"pTs"
object by using apply
on the columns of the
object. Depending on the output of the applied function, this gives a
"pField"
or "pTs"
object with only one, or with several time
steps.
1 |
data |
a |
FUN |
the function to be applied. |
newtime |
the observation time point(s) of the result. For |
... |
further arguments passed on to |
a "pField"
or "pTs"
object with the results of the
function applied.
Thomas Laepple
Function copied from "basis.R" in paleolibary/src/.
1 2 3 4 5 6 7 8 9 10 | x <- pField(data = array(rnorm(10 * 10 * 100), dim = c(10, 10, 100)),
time = 1 : 100, lat = 1 : 10, lon = 1 : 10)
y <- ApplyTime(x, mean)
# subset incompletely to create a pTs object
x.pts <- x[, 1 : 15]
y.pts <- ApplyTime(x.pts, mean) # is the same as y[, 1 : 15]
# you need to supply a new time axis e.g. for use cases such as
y <- ApplyTime(x, range, newtime = c(1, 2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.