Learn R Programming

spacetime (version 0.5-7)

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

## S3 method for class 'STF,STF':
over(x, y, returnList = FALSE, fn = NULL, ..., timeInterval = FALSE)
## S3 method for class 'xts,xts':
over(x, y, returnList = FALSE, fn = NULL, ..., timeInterval = TRUE)
## S3 method for class 'ST':
aggregate(x, by, FUN = mean, \dots, simplify = TRUE)

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
timeInterval
logical; if TRUE, time will considered as interval, otherwise as instance; but read note below
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
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

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.

    Function aggregate.ST aggregates the attribute values of x over the geometry (space, time, or space-time) of by, using aggregation function FUN.

See Also

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