https://github.com/cran/spacetime
Tip revision: 404b49a90640d3931093d071b98e4534f4adb3a4 authored by Edzer Pebesma on 25 September 2012, 08:22:32 UTC
version 0.8-0
version 0.8-0
Tip revision: 404b49a
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)
}
)