createSTdata {SpatioTemporal} | R Documentation |
Creates a STdata
object that can be used as input for
createSTmodel
. Names and dates are derived from the input data,
either using predefined fields or rownames
/ colnames
; for
details see the sub-functions linked under the relevant Arguments.
createSTdata(obs, covars, SpatioTemporal = NULL, transform.obs = function(x) { return(x) }, mean.0.ST = FALSE, n.basis = 0, extra.dates = NULL, ..., detrend = FALSE, region = NULL, method = NULL)
obs |
Either a data.frame with fields |
covars |
matrix/data.frame of covariates; should include both
geographic covariates and coordinates of all locations, see
|
SpatioTemporal |
possible spatio-temporal covariate, see
|
transform.obs |
function to apply to the observations,
defaults to an identity transform. Possible options are
|
mean.0.ST |
Call |
n.basis |
Number of temporal components in the smooth trends computed
by |
extra.dates |
Additional dates for which smooth trends should be
computed, used by |
... |
Additional parameters passed to |
detrend |
Use |
region, method |
Additional parameters passed to
|
A STdata
object with, some or all of, the following elements:
covars |
Geographic covariates, locations and names
of the observation locations (the later in |
trend |
The temporal trends with one of the columns
being named |
obs |
A data.frame with columns:
|
SpatioTemporal |
A 3D-array of spatio-temporal covariates, or |
old.trend,fit.trend |
Additional components added if the observations
have been detrended, see
|
Johan Lindstrom and Assaf P. Oron
Other STdata methods: plot.STdata
,
print.STdata
,
print.summary.STdata
,
qqnorm.predCVSTmodel
,
scatterPlot.predCVSTmodel
,
summary.STdata
Other STdata functions: c.STmodel
,
createDataMatrix
,
createSTmodel
, detrendSTdata
,
estimateBetaFields
,
removeSTcovarMean
,
updateTrend.STdata
##load the raw data data(mesa.data.raw) ##extract observations and covariates obs <- mesa.data.raw$obs covars <- mesa.data.raw$X ##list with the spatio-temporal covariates ST.list <- list(lax.conc.1500=mesa.data.raw$lax.conc.1500) ##create STdata object mesa.data <- createSTdata(obs, covars, SpatioTemporal=ST.list) print(mesa.data) ##create object with mean 0 spatio temporal covariate mesa.data.2 <- createSTdata(obs, covars, SpatioTemporal=ST.list, mean.0.ST=TRUE) print(mesa.data.2) ##create object with mean 0 spatio temporal covariate, and ##trend with two components, and additional dates (every seventh day) extra.dates <- seq(min(as.Date(rownames(obs))), max(as.Date(rownames(obs))), by=7) mesa.data.3 <- createSTdata(obs, covars, n.basis=2, extra.dates=extra.dates) print(mesa.data.3)