over: consistent spatio-temporal overlay for objects inheriting...

Description Usage Arguments Value Methods Note Author(s) References See Also


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


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



geometry (S/T locations) of the queries


layer from which the geometries or attributes are queried


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


(optional) a function; see value


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.


aggregation function


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


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.


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.


See also over; methods intersecting SpatialLines with anything else, or SpatialPolygons with SpatialPolygons, need rgeos to be loaded first.


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



See Also

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

spacetime documentation built on May 29, 2017, 11:03 p.m.

Search within the spacetime package
Search all R packages, documentation and source code