https://github.com/cran/spacetime
Raw File
Tip revision: dadc1ac88cff04c9634fc0885cc087f229c59fca authored by Edzer Pebesma on 06 September 2013, 00:00:00 UTC
version 1.0-9
Tip revision: dadc1ac
Class-STTDF.R
setClass("STT",  # space-time trajectory/ies without data values
  contains = "ST", 
  #slots = c(traj = "list"),
  representation(traj = "list"),
  validity = function(object) {
    stopifnot(length(object@traj) > 0)
	stopifnot(length(object@sp) == 2)
	stopifnot(length(object@time) == 2)
	stopifnot(all(sapply(object@traj, class) == "STI"))
	stopifnot(!isTRUE(timeIsInterval(object)))
    return(TRUE)
  }
)

setClass("STTDF",  # space-time trajectory/ies with data values
  contains = "STT", 
  #slots = c(data = "data.frame"),
  representation(data = "data.frame"),
  validity = function(object) {
	stopifnot(sum(sapply(object@traj, length)) == nrow(object@data))
    .checkAttrIsUnique(object@sp, object@time, object@data)
    return(TRUE)
  }
)
back to top