Skip to content
Prev 22931 / 29559 Next

Extend spacetime ST

Edzer,

Upon implementing your suggested:
Class "watch_circ" [in ".GlobalEnv"]

Slots:

Name:         ID        sp      time   endTime
Class: character   Spatial       xts   POSIXct

Extends: "ST"

I had to do more reading unless all I was going to say was "Wow".
Class "watch_circ" [in ".GlobalEnv"]

Slots:

Name:         ID        sp      time   endTime
Class: character   Spatial       xts   POSIXct

Extends: "ST"
$ST
An object of class "SClassExtension"
Slot "subClass":
[1] "watch_circ"

Slot "superClass":
[1] "ST"

Slot "package":
[1] ".GlobalEnv"

Slot "coerce":
function (from, strict = TRUE)
{
    class(from) <- "ST"
    from
}

Slot "test":
function (object)
TRUE
<bytecode: 0x19516f58>
<environment: namespace:methods>

Slot "replace":
function (from, to, value)
{
    for (what in c("sp", "time", "ID", "endTime")) slot(from,
        what) <- slot(value, what)
    from
}

Slot "simple":
[1] TRUE

Slot "by":
character(0)

Slot "dataPart":
[1] FALSE

Slot "distance":
[1] 1


$watch_circ
[1] TRUE
Is there a way to control the slots =c(ID, "character") order as to
prepending or postpending.
ie. (sp, time, endTime, ID) vs (ID, sp, time, endTime), or is the behavior
of subclassing the
superclass necessarily going to prepend the subclass slot(s) to the
superclass slots. It just seems on
a vernacular level that the order (sp, time, endTime, ID) is more ST-like
and signals the extending.

contains = does just what I need, or more properly want, is powerful, and
probably should be used
with caution by the magician's apprentice.

contains also leads me back to my prior 'wish list' of epochal endTimes.
Even the constraint language
of ST construction:

if (any(is.na(endTime)))
        stop("NA endTime values not allowed")

suggests toying with the concept of multiple (user defined) endTimes, or it
would merely say "NA endTime value not allowed", singular as to value, full
stop.  And with contains in mind and Pebesma (2008) "Customizing spatial
data
classes and methods" I start to see a way, ala Michael Sumner to
potentially using epochal endTimes
to extract all valid (or invalid for that matter) condition 2 quadrant 3
paths for normals and subjects to
evaluate as a TracksCollection.  Well, we'll see.

Thanks very much,

Chris




On Sat, Jun 6, 2015 at 9:47 AM, Edzer Pebesma <edzer.pebesma at uni-muenster.de