STIDF-class | R Documentation |
A class for unstructured spatio-temporal data; for n spatial locations and times, n observations are available
STI(sp, time, endTime)
STIDF(sp, time, data, endTime)
## S4 method for signature 'STIDF'
x[i, j, ..., drop = FALSE]
## S4 method for signature 'STIDF,STSDF'
coerce(from, to, strict=TRUE)
sp |
object of class Spatial |
time |
object holding time information; when STIDF is called,
a non-ordered vector with times, e.g. POSIXct will also work,
and rearrange the |
endTime |
vector of class |
data |
data frame with appropriate number of rows |
x |
an object of class STFDF |
i |
selection of record index (spatial/temporal/spatio-temporal entities) |
j |
or character string with temporal selection |
... |
first element is taken as column (variable) selector |
drop |
if TRUE and a single spatial entity is selected, an object
of class xts is returned (NOT yet implemented);
if TRUE and a single temporal entity is
selected, and object of the appropriate |
from |
object of class STFDF |
to |
target class |
strict |
ignored |
Objects of this class carry full space/time grid data
sp
:Object of class "Spatial"
time
:Object holding time information, see ST-class
data
:Object of class data.frame
, which holds
the measured values
signature(x = "STIDF")
: selects spatial-temporal entities, and attributes
arguments sp
, time
and data
need
to have the same number of records,
and regardless of the class of time (xts or POSIXct) have to be
in correspoinding order: the triple sp[i]
, time[i]
and data[i,]
refer to the same observation
Edzer Pebesma, edzer.pebesma@uni-muenster.de
https://www.jstatsoft.org/v51/i07/
sp = cbind(x = c(0,0,1), y = c(0,1,1))
row.names(sp) = paste("point", 1:nrow(sp), sep="")
library(sp)
sp = SpatialPoints(sp)
time = as.POSIXct("2010-08-05")+3600*(10:13)
m = c(10,20,30) # means for each of the 3 point locations
mydata = rnorm(length(sp)*length(time),mean=rep(m, 4))
IDs = paste("ID",1:length(mydata))
mydata = data.frame(values = signif(mydata,3), ID=IDs)
stidf = as(STFDF(sp, time, mydata), "STIDF")
stidf[1:2,]
all.equal(stidf, stidf[stidf,])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.