| sptExtract | R Documentation |
Function to extract spatio-temporal environmental data for given locations and certain time interval.
sptExtract(locations, env_data, tres = "month")
locations |
A spatial points data frame. |
env_data |
A raster time series object. |
tres |
A time interval. |
data frame with the environmental data for each location lm.
## Not run:
# Read Species Data
library(climateNiche)
sp_data <- get(data("Equus_quagga"))
# Remove entries where no month is provided
sp_data <- sp_data[which(!is.na(sp_data$month)),]
# Get environmental data
prec <- raster::getData(name = "worldclim", var = "prec", res = 10)
sp_prec_mon <- sptExtract(sp_data, prec, tres="month")
sp_prec_qtr <- sptExtract(sp_data, prec, tres="quarter")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.