Learn R Programming

sp (version 0.9-78)

over-methods: consistent spatial overlay for points, grids and polygons

Description

consistent spatial overlay for points, grids and polygons: retrieves the indexes or attributes from one geometry at the spatial locations of another

Usage

over(x, y, returnList = FALSE, fn = NULL, ...)
x %over% y
## S3 method for class 'Spatial':
aggregate(x, by, FUN = mean, \dots)

Arguments

x
geometry (locations) of the queries
y
layer from which the geometries or attributes are queried
returnList
logical; see value
fn
(optional) a function; see value
by
geometry over which attributes in x are aggregated
FUN
aggregation function
...
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) 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.Spatial aggregates the attribute values of x over the geometry of by, using aggregation function FUN.

See Also

overlay, point.in.polygon