spatial {vegsoup} | R Documentation |
Vegsoup*
Objects Spatial methods as defined in package sp.
## S4 method for signature 'Vegsoup' coordinates(obj) ## S4 method for signature 'Sites' coordinates(obj) ## S4 replacement method for signature 'Vegsoup' coordinates(obj) <- value ## S4 method for signature 'Vegsoup' bbox(obj) ## S4 method for signature 'Vegsoup' bbox(x) ## S4 method for signature 'Vegsoup' proj4string(obj) ## S4 replacement method for signature 'Vegsoup' proj4string(obj) <- value ## S4 method for signature 'Vegsoup' spTransform(obj, CRS) ## S4 method for signature 'Vegsoup' SpatialPointsVegsoup(obj) ## S4 method for signature 'Vegsoup' SpatialPolygonsVegsoup(obj) ## S4 method for signature 'Vegsoup' over(x, y, returnList = FALSE, fn = NULL, ...)
x, obj |
|
y |
|
value |
For For |
CRS |
An object of class |
... |
Additional arguments, not used. |
returnList, fn |
See |
All methods operate on the spatial slots of an object:
SpatialPointsVegsoup
and SpatialPolygonsVegsoup
.
coordinates
retrieves or sets the spatial coordinates. Note, in
contrast to the generic method defined in package sp it is possible
to set coordinates, where they have already been set (accounts for class
Vegsoup only)! The coordinates method for class Sites
tries to get coordinates from named variables longitude and latitude,
otherwise simulated coordinates in the unit square
(runif(length(unique(obj$plot)), min = 0, max = 1)
) are returned.
bbox
retrieves the spatial extent (extremes) from coordinates(obj)
.
extent
returns the same but as class Extent
.
proj4string
retrieves or sets the projection attributes (coordinate
reference system). See proj4string
and
CRS
for details.
spTransform
provides transformation between datum(s) and conversion between
projections (also known as projection and/or re-projection). Note, load package
rgdal for spTransform method to work.
over
provides an overlay method for spatial polygons.
An object depending on the input class.
Roland Kaiser
require(vegsoup) data(barmstein) x <- barmstein # coordinate reference system of data set is WGS 84 proj4string(x) # transform to WGS 84 / Pseudo Mercator require(rgdal) xt <- spTransform(x, CRS("+init=epsg:3857")) # plain matrix of coordiantes coordinates(x) # bounding box, as defined in package 'sp' bbox(x) # extent, the same as above but returned as class 'Extent' # as defined in package 'raster' extent(x) # assign new coordinates # first create the data as columns x$X <- rnorm(nrow(x)) x$Y <- rnorm(nrow(x)) sites(x) # use the formula interface coordinates(x) <- ~X+Y coordinates(x) # get slot 'sp.points' as sp class class(SpatialPointsVegsoup(x)) # get slot 'sp.polygons' as sp class class(SpatialPolygonsVegsoup(x))