https://github.com/cran/spacetime
Tip revision: 44dcc8149ae24d3eac14d8550e44ecc54fc993df authored by Edzer Pebesma on 17 November 2012, 16:21:04 UTC
version 1.0-2
version 1.0-2
Tip revision: 44dcc81
Class-STSDF.R
setClass("STS", # space-time partial
representation("ST", index = "matrix"),
validity = function(object) {
stopifnot(ncol(object@index) == 2)
ix = unique(object@index[,1]) # space
stopifnot(min(ix) >= 1 && max(ix) <= length(object@sp))
ix = unique(object@index[,2]) # time
stopifnot(min(ix) >= 1 && max(ix) <= nrow(object@time))
return(TRUE)
}
)
setClass("STSDF", # space-time partial data frame
representation("STS", data = "data.frame"),
validity = function(object) {
stopifnot(nrow(object@index) == nrow(object@data))
stopifnot(ncol(object@index) == 2)
ix = unique(object@index[,1]) # space
stopifnot(min(ix) >= 1 && max(ix) <= length(object@sp))
ix = unique(object@index[,2]) # time
stopifnot(min(ix) >= 1 && max(ix) <= nrow(object@time))
.checkAttrIsUnique(object@sp, object@time, object@data)
return(TRUE)
}
)