Description Usage Arguments Details Value Author(s) Source See Also Examples
This function takes a base R vector, matrix, or ts object and converts it to
a "pTs"
object.
1 2 3 4 5 6 7 8 9 10 |
data |
a vector, matrix or ts object to be converted. If missing, a
matrix, filled with |
time |
vector of time points corresponding to the observations in the
proxy time series; must be equidistant. If |
lat |
numeric vector giving the latitude(s) of the sampling location(s) of the proxy time series. |
lon |
vector of length 1 giving the longitude(s) of the sampling location(s) of the proxy time series. |
name |
vector of character strings with the names of the |
history |
character string to append to the history attribute of the
|
date |
logical, whether or not to append the current date to the
history attribute; defaults to |
kTol |
tolerance to check for equidistance of time steps; defaults to 1/400. |
"pTs"
("proxy time series"
) objects are enhanced time-series
ts
objects. pTs()
adds attributes such as
longitude and latitude to a time series vector/time series vectors and
assigns the class "pTs"
to the resulting object. More than one time
series vectors need to have the same time basis and can either stem from the
same location (i.e. different data sets/proxies recorded at the same site,
thus lat
, lon
are of length 1), or it can be the same proxy
data recorded at different sites (i.e. lat
, lon
are vectors of
the same length > 1). The latter can be used for irregular data fields which
cannot be shaped into a pField
object.
An object of class "pTs"
.
Thomas Laepple; adapated by Thomas Münch
Function copied from "proxytype.R" in paleolibary/src/.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # 10 data sets from the same site (e.g. Kohnen Station, Antarctica)
dat <- matrix(rnorm(10 * 100), nrow = 100, ncol = 10)
dat.pts <- pTs(dat, lat = -75, lon = 0,
name = "10 proxy time series from Kohnen.")
# time vector is automatically created
time(dat.pts)
# supply a specific time vector
dat.pts <- pTs(dat, time = 1901 : 2000, lat = -75, lon = 0,
name = "10 proxy time series from Kohnen.")
time(dat.pts)
# supply data set names
dat.pts <- pTs(dat, time = 1901 : 2000, lat = -75, lon = 0,
name = paste("proxy", 1 : 10))
# 10 data sets from different sites
# (= irregular grid which cannot be shaped into a pField)
lat <- seq(-75, -85, length.out = 10)
lon <- seq(0, 90, length.out = 10)
dat.pts <- pTs(dat, time = 1901 : 2000, lat = lat, lon = lon,
name = "Proxy time series from 10 sites.")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.