Geodata
Geodata
Geodata
December 1, 2022
Type Package
Title Download Geographic Data
Version 0.5-3
Date 2022-11-30
Depends R (>= 3.5.0), terra
Encoding UTF-8
Suggests jsonlite, R.utils
Author Robert J. Hijmans [cre, aut], Aniruddha Ghosh [ctb], Alex Mandel [ctb]
Maintainer Robert J. Hijmans <[email protected]>
Description Functions for downloading of geographic data for use in spatial analysis and map-
ping. The package facilitates access to climate, elevation, land use, soil, species occurrence, ac-
cessibility, administrative boundaries and other data.
License GPL (>= 3)
BugReports https://github.com/rspatial/geodata/issues/
NeedsCompilation no
Repository CRAN
Date/Publication 2022-12-01 16:00:06 UTC
R topics documented:
geodata-package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
cmip6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
country_codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
cropland . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
crop_calendar_sacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
crop_monfreda . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
crop_spam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
elevation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
gadm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
landcover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1
2 geodata-package
osm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
population . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
soil_af . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
soil_af_elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
soil_af_isda . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
soil_world . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
soil_world_vsi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
sp_occurrence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
travel_time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
world . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
worldclim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Index 28
Description
Functions for downloading of geographic data for use in spatial analysis and mapping. The package
facilitates access to climate, elevation, land use, soil, species occurrence, accessibility, administra-
tive boundaries and other data.
Function Description
cmip6_world Downscaled and calibrated CMIP6 projected future climate data
cmip6_tile Downscaled and calibrated CMIP6 data by tile
country_codes Country codes
crop_calendar_sacks Sachs crop calendar data
crop_monfreda Monfreda crop data (area, yield)
crop_spam SPAM crop data (area, yield, value)
cropland Cropland density for the world from three sources
elevation_3s Elevation data for tile (3 seconds resolution)
elevation_30s Elevation data for by country (30 seconds resolution)
elevation_global Global elevation data (various resolutions)
gadm Administrative boundaries for any country in the world
world Boundaries for the countries in the world
landcover Global landcover data
footprint Human footprint data
osm OpenStreetMap data by country
population Download population density data
soil_af_elements Soil element concentration data for Africa
soil_af_isda Soil data for Africa derived from the iDSA data set
soil_af Chemical soil properties data for Africa for different soil depths
soil_world_vsi Virtually connect to the global soilgrids data
soil_world Global soils data
sp_occurrence Species occurrence data from the Global Biodiversity Information Facility
travel_time Travel time to cities and ports
worldclim_global Global climate data
cmip6 3
Description
Download downscaled and calibrated CMIP6 climate data for projected future climates. Either for
the entire world or for a 30 degrees tile. For more information see https://www.worldclim.org/
Usage
cmip6_world(model, ssp, time, var, res, path, ...)
Arguments
model character. Climate model abbrevation. One of "ACCESS-CM2", "ACCESS-
ESM1-5", "AWI-CM-1-1-MR", "BCC-CSM2-MR", "CanESM5", "CanESM5-
CanOE", "CMCC-ESM2", "CNRM-CM6-1", "CNRM-CM6-1-HR", "CNRM-
ESM2-1", "EC-Earth3-Veg", "EC-Earth3-Veg-LR", "FIO-ESM-2-0", "GFDL-
ESM4", "GISS-E2-1-G", "GISS-E2-1-H", "HadGEM3-GC31-LL", "INM-CM4-
8", "INM-CM5-0", "IPSL-CM6A-LR", "MIROC-ES2L", "MIROC6", "MPI-
ESM1-2-HR", "MPI-ESM1-2-LR", "MRI-ESM2-0", "UKESM1-0-LL"
ssp character. A valid Shared Socio-economic Pathway code: "126", "245", "370"
or "585".
time character. A valid time period. One of "2021-2040", "2041-2060", or "2061-
2080"
var character. Valid variables names are "tmin", "tmax", "tavg", "prec" and "bioc"
res numeric. Valid resolutions are 10, 5, 2.5 (minutes of a degree)
path character. Path where to download the data to
... additional arguments passed to download.file
lon numeric. Longitude
lat numeric. Latitude
Value
SpatRaster
See Also
vrt to combine tiles
4 cropland
Examples
Description
Get country codes for all countries in the world.
Usage
country_codes()
Value
data.frame
Examples
cc <- country_codes()
head(cc)
Description
Cropland distribution data at a 30-seconds spatial resolution from three sources:
worldcover is derived from the ESA WorldCover data set at 0.3-seconds resolution. (License
CC BY 4.0), see https://esa-worldcover.org/en. Values were aggregated and represent the
fraction cropland in each cell.
glad is derived from the "Global cropland expansion in the 21st century" (Potatov et al) data avail-
able here. Values were aggregated and resampled. They represent the fraction cropland in each cell.
There are five layers representing the following years: 2003, 2007, 2011, 2015, and 2019.
QED has cropland distribution data for Africa. The values are probabilities of cropland presence
estimated with a neural network that was trained on an initial 1-million point Geosurvey conducted
in 2015. License: CC-BY-SA 4.0; https://about.maps.qed.ai/
Usage
cropland(source, path, year, ...)
crop_calendar_sacks 5
Arguments
source character. One of "WorldCover", "GLAD", or "QED"
path character. Path name where the data should be downloaded to
year numeric. Optional for the GLAD dataset to get data for a single year. One of
2003, 2007, 2011, 2015, and 2019
... additional arguments passed to download.file
Value
SpatRaster
References
WorldCover: Zanaga, D., Van De Kerchove, R., De Keersmaecker, W., Souverijns, N., Brockmann,
C., Quast, R., Wevers, J., Grosu, A., Paccini, A., Vergnaud, S., Cartus, O., Santoro, M., Fritz, S.,
Georgieva, I., Lesiv, M., Carter, S., Herold, M., Li, Linlin, Tsendbazar, N.E., Ramoino, F., Arino,
O., 2021. ESA WorldCover 10 m 2020 v100. doi:10.5281/zenodo.5571936.
GLAD: Potapov, P., S. Turubanova, M.C. Hansen, A. Tyukavina, V. Zalles, A. Khan, X.-P. Song,
A. Pickens, Q. Shen, J. Cortez, 2021. Global maps of cropland extent and change show accelerated
cropland expansion in the twenty-first century. Nature Food. doi:10.1038/s43016-021-00429-z
See Also
landcover
Examples
Description
Download Sacks crop calendar data. The crops available are returned by sacksCrops
Usage
crop_calendar_sacks(crop="", path, ...)
sacksCrops()
6 crop_monfreda
Arguments
Value
SpatRaster
References
Sacks, W.J., D. Deryng, J.A. Foley, and N. Ramankutty, 2010. Crop planting dates: an anal-
ysis of global patterns. Global Ecology and Biogeography 19: 607-620. doi:10.1111/j.1466-
8238.2010.00551.x.
See Also
https://sage.nelson.wisc.edu/data-and-models/datasets/crop-calendar-dataset/
Examples
Description
Usage
monfredaCrops()
crop_monfreda(crop="", var="area_ha", path, ...)
crop_spam 7
Arguments
Value
SpatRaster
References
Monfreda, C., N. Ramankutty, and J. A. Foley (2008), Farming the planet: 2. Geographic distribu-
tion of crop areas, yields, physiological types, and net primary production in the year 2000, Global
Biogeochem. Cycles, 22, GB1022, doi:10.1029/2007GB002947.
See Also
http://www.earthstat.org/harvested-area-yield-175-crops/
Examples
Description
Usage
spamCrops()
crop_spam(crop="", var="area", path=".", africa=FALSE, ...)
8 elevation
Arguments
crop character. See spamCrops for valid names
var character. variable of interest. Must be one of "yield", "harv_area" (harvested
area), "phys_area" (physical area), "prod" (production) or "val_prod" (value of
production)
path character. Path name where the data should be downloaded to
africa logical. retrieve the (updated) data for Africa instead of global data
... additional arguments passed to download.file
Value
SpatRaster
References
International Food Policy Research Institute, 2020. Spatially-Disaggregated Crop Production Statis-
tics Data in Africa South of the Sahara for 2017. https://doi.org/10.7910/DVN/FSSKBW, Harvard
Dataverse, V2
See Also
https://www.mapspam.info/data/
Examples
elevation Elevation
Description
Get elevation data for any country in the world. The main data source is Shuttle Radar Topography
Mission (SRTM) , specifically the hole-filled CGIAR-SRTM (90 m resolution) from https://srtm.csi.cgiar.org/.
These data are only available for latitudes between -60 and 60.
The 1 km (30 arc seconds) data were aggregated from SRTM 90 m resolution data and supplemented
with the GTOP30 data for high latitudes (>60 degrees).
Usage
elevation_3s(lon, lat, path, ...)
elevation_30s(country, path, mask=TRUE, subs="", ...)
elevation_global(res, path, ...)
footprint 9
Arguments
lon numeric. Longitude
lat numeric. Latitude
path character. Path where to download the data to
country character. Country name or code
mask logical. set grid cells outside of the country boundaries to NA
subs character
res numeric. Valid resolutions are 10, 5, 2.5, and 0.5 (minutes of a degree)
... additional arguments passed to download.file
Value
SpatRaster
Examples
## Not run:
elevation_30s(country="FRA", path=tempdir() )
## End(Not run)
Description
The "human footprint" is an estimate of the direct and indirect human pressures on the environment.
The human pressure is measured using eight variables including built-up environments, population
density, electric power infrastructure, crop lands, pasture lands, roads, railways, and navigable wa-
terways. It is expressed on a scale of 0 (low) to 50 (high footprint). See https://www.nature.com/articles/sdata201667
for the details. And the original data is available here: https://sedac.ciesin.columbia.edu/data/collection/wildareas-
v3
Data are available for two years: 1993 and 2009, for all terrestrial areas except Antarctica. The
footprint of seas and oceans was set to zero. The original data was in the Mollweide projection at
a 1000 m spatial resolution. The data available through this function was transformed to a longi-
tude/latitude grid at 30-seconds resolution.
Users are free to use, copy, distribute, transmit, and adapt the work for commercial and non-
commercial purposes, without restriction, as long as clear attribution of the source is provided.
Usage
footprint(year=2009, path, ...)
10 gadm
Arguments
year character. "1993" or "2009"
path character. Path name where the data should be downloaded to
... additional arguments passed to download.file
Value
SpatRaster
References
Venter, O., E. W. Sanderson, A. Magrach, J. R. Allan, J. Beher, K. R. Jones, H. P. Possingham, W.
F. Laurance, P. Wood, B. M. Fekete, M. A. Levy, and J. E. Watson. 2016. Sixteen Years of Change
in the Global Terrestrial Human Footprint and Implications for Biodiversity Conservation. Nature
Communications 7:12558. https://doi.org/10.1038/ncomms12558.
See Also
landcover
Description
Get administrative boundaries for any country in the world. Data are read from files that are down-
loaded if necessary.
Usage
gadm(country, level=1, path, version="latest", resolution=1, ...)
Arguments
country character. Three-letter ISO code or full country name. If you provide multiple
names they are all downloaded and rbind-ed together
level numeric. The level of administrative subdivision requested. (starting with 0 for
country, then 1 for the first level of subdivision)
path character. Path name indicating where to store the data
version character. Either "latest" or GADM version number (can be "3.6", "4.0" or "4.1")
resolution integer indicating the level of detail. Only for version 4.1. It should be either 1
(high) or 2 (low)
... additional arguments passed to download.file
landcover 11
Details
The data are from https://gadm.org
Value
SpatVector
See Also
world
Examples
Description
Landcover data at 30-seconds spatial resolution for (most of) the world. Values are the fraction
of a landcover class in each cell. The values are derived from the ESA WorldCover data set at
0.3-seconds resolution. (License CC BY 4.0). See https://esa-worldcover.org/en for more
information.
Usage
landcover(var, path, ...)
Arguments
var character. One of "trees", "grassland", "shrubs", "cropland", "built", "bare",
"snow", "water", "wetland", "mangroves", "moss"
path character. Path name where the data should be downloaded to
... additional arguments passed to download.file
Value
SpatRaster
References
Zanaga, D., Van De Kerchove, R., De Keersmaecker, W., Souverijns, N., Brockmann, C., Quast, R.,
Wevers, J., Grosu, A., Paccini, A., Vergnaud, S., Cartus, O., Santoro, M., Fritz, S., Georgieva, I.,
Lesiv, M., Carter, S., Herold, M., Li, Linlin, Tsendbazar, N.E., Ramoino, F., Arino, O., 2021. ESA
WorldCover 10 m 2020 v100. doi:10.5281/zenodo.5571936.
12 osm
See Also
landcover
Description
Usage
Arguments
Details
tbd
License: Open Data Commons Open Database License (ODbL). See https://www.openstreetmap.
org/copyright
Value
SpatVector
Examples
Description
Usage
Arguments
Value
SpatRaster
References
Center for International Earth Science Information Network - CIESIN - Columbia University. 2018.
Gridded Population of the World, Version 4 (GPWv4): Population Density, Revision 11. Palisades,
NY: NASA Socioeconomic Data and Applications Center (SEDAC). doi:10.7927/H49C6VHW. Ac-
cessed 6 July 2021.
Examples
Description
Download chemical soil properties data for Africa for different soil depths. The spatial resolution
is 30 arc-seconds (about 1 km2), aggregated from the original 250m resolution.
There are more recent estimations for some of the properties available in other data sets. See
soil_af_isda and soil_world.
For more info, see https://www.isric.org/projects/soil-property-maps-africa-250-m-resolution
The data have a CC-BY 4.0 NC license
Usage
soil_af(var, depth, path, ...)
Arguments
var character. Variables name such as "pH" or "clay". See Details
depth numeric. One of 5, 15, 30, 60, 100, 200. This is shorthand for the following
depth ranges: 0-5, 5-15, 15-30, 30-60, 60-100, 100-200 cm. Or one of 20, 50
for 0-20 or 20-50 cm
path character. Path to download the data to
... additional arguments passed to download.file
Details
Value
SpatRaster
References
Hengl T, Heuvelink GBM, Kempen B, Leenaars JGB, Walsh MG, Shepherd KD, et al. (2015)
Mapping Soil Properties of Africa at 250 m Resolution: Random Forests Significantly Improve
Current Predictions. PLoS ONE 10(6): e0125814. doi:10.1371/journal.pone.0125814
See Also
soil_af_elements, soil_af_isda, soil_world_vsi
Examples
Description
Connect to or download chemical soil element concentration (for the 0-30 cm topsoil) data for
Africa. The spatial resolution is 30 arc-seconds (about 1 km2), aggregated from the original 250 m
spatial resolution.
The data have an Open Data Commons Open Database License (ODbL)
For more information, see https://www.isric.org/projects/soil-property-maps-africa-250-m-resolution
Usage
soil_af_elements(var, path, ...)
16 soil_af_elements
Arguments
var character. Variables name. One of: "Al", "B", "Ca", "Cu", "Fe", "K", "Mg",
"Mn", "N", "Na", "P", "Ptot", "Zn". See Details
path character. Path to download the data to
... additional arguments passed to download.file
Details
Value
SpatRaster
References
Hengl T, Heuvelink GBM, Kempen B, Leenaars JGB, Walsh MG, Shepherd KD, et al. (2015)
Mapping Soil Properties of Africa at 250 m Resolution: Random Forests Significantly Improve
Current Predictions. PLoS ONE 10(6): e0125814. doi:10.1371/journal.pone.0125814
See Also
soil_af, soil_af_isda, soil_world
Examples
Description
Download soil data for Africa derived from the iDSA data set. The original data were aligned and
aggregated to 30 arc-seconds (about 1 km2). The original spatial resolution was 30m.
For more info see:
https://envirometrix.nl/isdasoil-open-soil-data-for-africa/
https://zenodo.org/search?page=1&size=20&q=iSDAsoil
Usage
soil_af_isda(var, depth=20, error=FALSE, path, ...)
Arguments
var character. The variables name, one of: "Al", "bdr", "clay", "C.tot", "Ca", "db.od",
"eCEC.f", "Fe", "K", "Mg", "N.tot", "oc", "P", "pH.H2O", "sand", "silt", "S",
"texture", "wpg2", "Zn".see Details
depth numeric. One of 20 (for 0-20 cm) and 50 (for 20-50 cm). Ignored if var="bdr"
for which the depth is always 0-200 cm
error logical. If TRUE the error estimates are returned
path character. Path name where the data should be downloaded to
... additional arguments passed to download.file
Details
Value
SpatRaster
References
Tomislav Hengl, Matthew A. E. Miller, Josip Križan, Keith D. Shepherd, Andrew Sila, Milan
Kilibarda, Ognjen Antonijevic, Luka Glušica, Achim Dobermann, Stephan M. Haefele, Steve P.
McGrath, Gifty E. Acquah, Jamie Collinson, Leandro Parente, Mohammadreza Sheykhmousa,
Kazuki Saito, Jean-Martial Johnson, Jordan Chamberlin, Francis B. T. Silatsa, Martin Yemefack,
John Wendt, Robert A. MacMillan, Ichsani Wheeler & Jonathan Crouch, 2021. African soil prop-
erties and nutrients mapped at 30 m spatial resolution using two-scale ensemble machine learning.
Scientific Reports 11: 6130.
See Also
soil_af_elements, soil_af, soil_world
Examples
Description
Download global soils data. The data are derived from the SoilGRIDS database. The data were
aggregated and transformed to a longitude/latitude coordinate reference system with 30-second
spatial resolution.
See https://www.isric.org/explore/soilgrids for more info.
data license: CC-BY 4.0
Usage
soil_world(var, depth, stat="mean", name="", path, ...)
soil_world 19
Arguments
var character. Variables name. One of: "bdod", "cfvo", "clay", "nitrogen", "ocd",
"ocs", "phh2o", "sand", "silt", "soc", "wrb". See Details
depth numeric. One of 5, 15, 30, 60, 100, 200. This is shorthand for the follow-
ing depth ranges: 0-5, 5-15, 15-30, 30-60, 60-100, 100-200 cm. Ignored if
var="wrb"
stat character. One of "mean", "uncertainty", "Q0.05", "Q0.5", "Q0.95". Ignored if
var="wrb"
name character. One of "Acrisols", "Albeluvisols", "Alisols", "Andosols", "Arenosols",
"Calcisols", "Cambisols", "Chernozems", "Cryosols", "Durisols", "Ferralsols",
"Fluvisols", "Gleysols", "Gypsisols", "Histosols", "Kastanozems", "Leptosols",
"Lixisols", "Luvisols", "Nitisols", "Phaeozems", "Planosols", "Plinthosols", "Pod-
zols", "Regosols", "Solonchaks", "Solonetz", "Stagnosols", "Umbrisols", "Ver-
tisols". Only used when var="wrb"
path character. Path name where the data should be downloaded to
... additional arguments passed to download.file
Details
Value
SpatRaster
References
Poggio L., de Sousa L.M., Batjes N.H., Heuvelink G.B.M., Kempen B., Ribeiro E., Rossiter D.,
2021. SoilGrids 2.0: producing soil information for the globe with quantified spatial uncertainty.
Soil 7:217-240, 2021. doi:10.5194/soil-7-217-2021
20 soil_world_vsi
See Also
For virtual access to the original data: soil_world_vsi For Africa: soil_af_isda, soil_af,
soil_af_elements
Examples
Description
Virtually connect to the global soilgrids data. See https://www.isric.org/explore/soilgrids for more
info.
data license: CC-BY 4.0
Usage
soil_world_vsi(var, depth, stat="mean", name="")
Arguments
var character. Variables name. One of: "bdod", "cfvo", "clay", "nitrogen", "ocd",
"ocs", "phh2o", "sand", "silt", "soc", "wrb". See Details
depth numeric. One of 5, 15, 30, 60, 100, 200. This is shorthand for the follow-
ing depth ranges: 0-5, 5-15, 15-30, 30-60, 60-100, 100-200 cm. Ignored if
var="wrb"
stat character. One of "mean", "uncertainty", "Q0.05", "Q0.5", "Q0.95". Ignored if
var="wrb"
name character. One of ’Acrisols’, ’Albeluvisols’, ’Alisols’, ’Andosols’, ’Arenosols’,
’Calcisols’, ’Cambisols’, ’Chernozems’, ’Cryosols’, ’Durisols’, ’Ferralsols’, ’Flu-
visols’, ’Gleysols’, ’Gypsisols’, ’Histosols’, ’Kastanozems’, ’Leptosols’, ’Lix-
isols’, ’Luvisols’, ’Nitisols’, ’Phaeozems’, ’Planosols’, ’Plinthosols’, ’Podzols’,
’Regosols’, ’Solonchaks’, ’Solonetz’, ’Stagnosols’, ’Umbrisols’, ’Vertisols’. Only
used when var="wrb"
Details
The below table lists the variable names, a description, and the units of the variables. Note that these
units are not standard units, and are different from the data for other soil data available through this
package.
Value
SpatRaster
References
Poggio, L., de Sousa, L.M., Batjes, N.H., Heuvelink, G.B.M., Kempen, B., Ribeiro, E., and Rossiter,
D., 2021. SoilGrids 2.0: producing soil information for the globe with quantified spatial uncertainty.
Soil 7:217-240, 2021. doi:10.5194/soil-7-217-2021
See Also
soil_world to download these data at 30-seconds spatial resolution.
For Africa: soil_af_isda, soil_af, soil_af_elements
Examples
Description
Download data from the Global Biodiversity Information Facility (GBIF) data portal.
sp_genus returns a data.frame with all the species names associated with a genus.
sp_occurrence downloads species occurrence records. You can download data for a single species
or for an entire genus by using species="". Note that the maximum number of records that can be
downloaded for a single search is 100,000.
You can check the number of records returned by using the option download=FALSE.
22 sp_occurrence
To avoid getting more than 100,000 records, you can do separate queries for different geographic
areas. If you want to download data for an entire genus, first run sp_genus and then download data
for the returned species names one by one.
Before using this function, please first check the GBIF data use agreement and see the note below
about how to cite these data.
Usage
sp_genus(genus, simple=TRUE, ...)
Arguments
genus character. genus name
species character. species name. Use ’*’ to download the entire genus. Append ’*’ to
the species name to get all naming variants (e.g. with and witout species author
name) and sub-taxa
ext Extent object to limit the geographic extent of the records. An extent can be
created using functions like ext and draw
args character. Additional arguments to refine the query. See query parameters in
http://www.gbif.org/developer/occurrence for more details
geo logical. If TRUE, only records that have a georeference (longitude and latitude
values) will be downloaded
removeZeros logical. If TRUE, all records that have a latitude OR longitude of zero will be
removed if geo==TRUE, or set to NA if geo==FALSE. If FALSE, only records that
have a latitude AND longitude that are zero will be removed or set to NA
download logical. If TRUE, records will be downloaded, else only the number of records
will be shown
ntries integer. How many times should the function attempt to download the data, if
an invalid response is returned (perhaps because the GBIF server is very busy)
nrecs integer. How many records to download in a single request (max is 300)?
start integer. Record number from which to start requesting data
end integer. Last record to request
fixnames If TRUE a few unwieldy and poorly chosen variable names are changed as fol-
lows. "decimalLatitude" to "lat", "decimalLongitude" to "lon", "stateProvince"
to "adm1", "county" to "adm2", "countryCode" to "ISO2". The names in "coun-
try" are replaced with the common (short form) country name, the original val-
ues are stored as "fullCountry"
simple logical. If TRUE, a vector the accepted species names are returned. Otherwise a
data.frame with much more information is returned
... additional arguments passed to download.file
travel_time 23
Value
data frame
Note
Under the terms of the GBIF data user agreement, users who download data agree to cite a DOI.
Citation rewards data-publishing institutions and individuals and provides support for sharing open
data [1][2]. You can get a DOI for the data you downloaded by creating a "derived" dataset. For
this to work, you need to keep the "datasetKey" variable in your dataset.
References
https://www.gbif.org/occurrence https://www.gbif.org/derived-dataset/about
Examples
## Not run:
sp_occurrence("solanum", download=FALSE)
sp_occurrence("solanum", "acaule", download=FALSE)
## End(Not run)
Description
Download travel time to a city or port data on rasters at a 30 arc-seconds (about 1 km2) resolution.
Usage
travel_time(to="city", size=1, up=FALSE, path, ...)
Arguments
to character. "city" or "port"
size positive integer indicating the size of the city or port. Can be between 1 and 9 if
to="city" or between 1 and 5 if to="port". See Details
up logical. If TRUE the travel time to a city of the size chosen or larger is returned
24 travel_time
Details
Description of the the size argument.
to="city"
size Inhabitants
1 5,000,000 to 50,000,000
2 1,000,000 to 5,000,000
3 500,000 to 1,000,000
4 200,000 to 500,000
5 100,000 to 200,000
6 50,000 to 100,000
7 20,000 to 50,000
8 10,000 to 20,000
9 5,000 to 10,000
to="port"
Value
SpatRaster
References
Nelson, A., D.J. Weiss, J. van Etten, A. Cattaneo, T.S. McMenomy & J. Koo, 2019. A suite of
global accessibility indicators. Scientific Data 6: 266. doi:10.1038/s41597-019-0265-5
Version 3 (2019-05-15) from https://figshare.com/articles/dataset/Travel_time_to_cities_
and_ports_in_the_year_2015/7638134/3
Examples
Description
Get the borders for all the countries in the world. Data are read from files that are downloaded if
necessary.
Usage
Arguments
resolution integer between 1 and 5 indicating the level of detail. 1 is high 5 is low
level numeric. The level of administrative subdivision requested. (starting with 0
for country, then 1 for the first level of subdivision). Only level 0 is currently
available
path character. Path name indicating where to store the data
version character. Only "3.6" is currently supported
... additional arguments passed to download.file
Details
Value
SpatVector
See Also
gadm
Examples
w <- world(path=tempdir())
26 worldclim
Description
Download climate data from WorldClim version 2.1. See Details for variables and units.
Usage
worldclim_global(var, res, path, version="2.1", ...)
worldclim_country(country, var, path, version="2.1", ...)
worldclim_tile(var, lon, lat, path, version="2.1", ...)
Arguments
var character. Valid variables names are "tmin", "tmax", "tavg", "prec", "wind",
"vapr", and "bio"
res numeric. Valid resolutions are 10, 5, 2.5, and 0.5 (minutes of a degree)
path character. Path where to download the data to
country character. Country name or code
lon numeric. Longitude
lat numeric. Latitude
version character or numeric. WorldClim version number. Only "2.1" supported at the
moment
... additional arguments passed to download.file
Details
These are the WorldClim monthly average climate data.
Value
SpatRaster
worldclim 27
See Also
https://www.worldclim.org/
Examples
footprint, 2, 9
gadm, 2, 10, 25
geodata (geodata-package), 2
geodata-package, 2
monfredaCrops (crop_monfreda), 6
osm, 2, 12
population, 2, 13
sacksCrops (crop_calendar_sacks), 5
28