createDataMatrix {SpatioTemporal} | R Documentation |
Creates a data matrix from a STdata
/STmodel
object.
Missing observations are marked as NA
.
createDataMatrix(STdata = NULL, obs = STdata$obs$obs, date = STdata$obs$date, ID = STdata$obs$ID, subset = NULL)
STdata |
A |
obs |
A vector of observations. |
date |
A vector of observation times. |
ID |
A vector of observation locations. |
subset |
A subset of locations to extract the data matrix for. A warning
is given for each name not found in |
Returns a matrix with dimensions (number of timepoints)-by-(number
of locations). Row and column names of the matrix are taken as ID
and sort(unique(date))
respectively.
Johan Lindstrom
Other data matrix: SVDmiss
,
SVDsmooth
,
estimateBetaFields
,
mesa.data.raw
Other STdata functions: c.STmodel
,
createSTdata
, createSTmodel
,
detrendSTdata
,
estimateBetaFields
,
removeSTcovarMean
,
updateTrend.STdata
Other STmodel functions: createCV
,
createSTmodel
,
dropObservations
,
estimateBetaFields
,
loglikeSTdim
, loglikeST
,
predictNaive
, processLUR
,
processLocation
, updateCovf
,
updateTrend.STdata
##load the data data(mesa.model) ##create a data matrix M1 <- createDataMatrix(mesa.model) dim(M1) head(M1) ##create data matrix for only a few locations M2 <- createDataMatrix(mesa.model, subset = c("60370002","60370016","60370113","60371002", "60371103","60371201","L001","L002")) dim(M2) head(M2)