Learn R Programming

spacetime (version 1.3-2)

over-methods: consistent spatio-temporal overlay for objects inheriting from ST

Description

consistent spatio-temporal overlay for STF, STS and STI objects, as well as their *DF counterpart: retrieves the indexes or attributes from one geometry at the spatio-temporal points of another

Usage

# S4 method for STF,STF
over(x, y, returnList = FALSE, fn = NULL, ...)
# S4 method for xts,xts
over(x, y, returnList = FALSE, fn = NULL, ...)
# S4 method for ST
aggregate(x, by, FUN, ..., simplify = TRUE)

Value

an object of length length(x), or a data.frame with number of rows equal to length(x). If returnList is FALSE, a vector with indices of y for each geometry (point, grid cell centre, polygon or lines x time point) in x. if returnList is TRUE, a list of length length(x), with list element i

the vector of indices of the geometries in y that correspond to the $i$-th geometry in x.

The aggregate method for ST objects aggregates the attribute values of x

over the geometry (space, time, or space-time) of by, using aggregation function FUN.

For the matching of time intervals, see timeMatch.

For setting, or retrieving whether time represents intervals, see timeIsInterval.

Arguments

x

geometry (S/T locations) of the queries

y

layer from which the geometries or attributes are queried

returnList

logical; determines whether a list is returned, or an index vector

fn

(optional) a function; see value

by

geometry over which attributes in x are aggregated (this can be a Spatial* geometry, or a ST* geometry), or temporal aggregation, such as "month", "10 minutes", or a function such as as.yearmon; see aggregate.zoo. In case x is of class STFDF, argument by may be "time" or "space", in which cases aggregation over all time or all space is carried out.

FUN

aggregation function

simplify

boolean; if TRUE, and space or time dimensions can be dropped, the simpler (Spatial or xts) object will be returned

...

arguments passed on to function fn or FUN

Methods

x = "STF", y = "STF"

x = "xts", y = "xts"

finds the row index of the instance or interval of time instances of x matching to y. Only if timeIsInterval(x) == TRUE, intervals are sought. In that case, time intervals start at the time instance of a record, and end at the next. The last time interval length is set to the interval length of the one-but-last (non-zero) interval. In case of a single time instance for y, its interval is right-open.

Author

Edzer Pebesma, edzer.pebesma@uni-muenster.de

References

https://www.jstatsoft.org/article/view/v051i07

See Also

over; vignette('sto'), vignette('over'), timeMatch, timeIsInterval