Description Usage Arguments Details Value Author(s) Examples
View source: R/extractWCdata.R
extractWCdata returns a data frame based on specified climatic variables.
1 | extractWCdata(sites, long, lat, var, res = 2.5)
|
sites |
object of class "data.frame" with coordinates of sites from which to extract data. |
long |
character. Name of column from |
lat |
character. Name of column from |
var |
character. Climatic variable(s) to be extracted: 'tavg', 'tmin', 'tmax', 'prec', 'bio', 'srad', 'vapr', 'wind' |
res |
numeric. Spatial resolution. Default 2.5 |
A grid can be created with any particular coordinates and used as input for sites
(see section 'Examples'). extractWCdata
will use the given coordinates to extract data from the WorldClim2.1 database.
The extracted data will most likely contain NA's for sites where climatic data is not available. These should be removed or imputed before using the data to make predictions.
An object of class "data.frame" with specified climatic variables for coordinates in sites
.
Zakaria Kehel, Fawzy Nawar, Bancy Ngatia, Khadija Aouzal
1 2 3 4 5 6 7 8 9 10 | if(interactive()){
# Create grid
sp1 <- seq(-16, 115, length = 10)
sp2 <- seq(25, 59, length = 10)
sp <- expand.grid(x = sp1, y = sp2)
# Extract data using grid
sp.df0 <- extractWCdata(sp, long = 'x', lat = 'y', var = 'tavg')
sp.df <- na.omit(sp.df0)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.