| STIDF-class {spacetime} | R Documentation |
Class "STIDF"
Description
A class for unstructured spatio-temporal data; for n spatial locations and times, n observations are available
Usage
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)
Arguments
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 from the Class
Objects of this class carry full space/time grid data
Slots
sp:Object of class
"Spatial"time:Object holding time information, see ST-class
data:Object of class
data.frame, which holds the measured values
Methods
- [
signature(x = "STIDF"): selects spatial-temporal entities, and attributes
Note
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
Author(s)
Edzer Pebesma, edzer.pebesma@uni-muenster.de
References
https://www.jstatsoft.org/v51/i07/
Examples
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,])