Description Usage Arguments Format Value Examples
The function takes a set of time-dependent coordinates and extracts the value they point to from associted RasterLayers in a RasterArray.
1 2 3 4 5 6 7 |
x |
( |
y |
( |
by |
( |
margin |
( |
lng |
( |
lat |
( |
force |
( |
An object of class standardGeneric
of length 1.
A numeric
vector
, matrix
or array
of values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # one pair of random coordinates from Africa
mat <- matrix(c(
-1.34, 42.96
), ncol=2, byrow=TRUE)
# repeat four times
mat<- mat[rep(1,4), ]
# assign default names and age
df<- data.frame(plng=mat[, 1],plat=mat[, 2], age=c(1,3,5, 1))
rownames(df) <- paste("point", 1:nrow(df))
# first coordinate pair will be extrated from RasterLayer 1 ["0"]
# second coordinate pair will be extracted from RasterLayer 3 ["10"]
# thrid coordinate pair will be extracted from RasterLayer 5 ["20"]
# fourth coordinate pair will be extracted from RasterLayer 1 ["0"]
data(dems)
extract(dems, df, by="age")
# by=NULL will be implemented in the next update
# (all coordinates extracted from all layers)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.