File: Class-STFDF.R

package info (click to toggle)
r-cran-spacetime 1.2-8%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,300 kB
  • sloc: sh: 13; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 582 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
setClass("STF", # space-time full
  contains = "ST",
  validity = function(object) {
	time = as.POSIXct(index(object@time))
	endTime = object@endTime
	n = length(endTime)
  	stopifnot(all(time <= endTime))
	if (n > 1)
  		stopifnot(all(endTime[1:(n-1)] <= time[-1]))
    return(TRUE)
  }
)

setClass("STFDF", # space-time full data frame
  contains = "STF", 
  slots = c(data = "data.frame"),
  validity = function(object) {
    stopifnot(nrow(object@data) == length(object@sp) * nrow(object@time))
    .checkAttrIsUnique(object@sp, object@time, object@data)
    return(TRUE)
  }
)