Description Usage Arguments Details Value Author(s) Examples
Extract the values of the cells of a "raster*"
object for the locations (SpatialPoints
) of a Vegsoup
object; that is perform a spatial query.
1 2 |
x |
A |
y |
A |
... |
Additional arguments passed to |
See the the documentation of extract
in raster for
details and additional arguments.
A vector for RasterLayer objects and a matrix for a RasterStack or RasterBrick object. A list
if a buffer
argument is used or data.frame df=TRUE
.
Roland Kaiser
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | require(raster)
# RasterLayer
r1 <- raster(ncol = 10, nrow = 10, xmn = 0, xmx = 1, ymn = 0, ymx = 1)
r1[] <- sample(1:ncell(r1))
x <- coenoflex()
plot(r1)
points(x)
extract(r1, x) # a vector
# RasterStack and RasterBrick
r2 <- raster(ncol = 10, nrow = 10, xmn = 0, xmx = 1, ymn = 0, ymx = 1)
r2[] <- sample(1:ncell(r2))
s <- stack(r1, r2)
b <- brick(r1, r2)
extract(s, x) # a matrix
extract(b, x) # a matrix
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.