The R package spatialData provides spatial ecological datasets from research papers as sf data frames ready for analysis and modeling. It was designed as example data for other spatial R packages, but works equally well for tutorials and teaching.
Installation
Install from CRAN.
install.packages("spatialData")Install the development version from GitHub.
library(pak)
pak::pkg_install("blasbenito/spatialData")Data Loading
As with other example datasets in the R language, the different datasets in spatialData can be loaded with the function data().
library(spatialData)
#>
#> Attaching package: 'spatialData'
#> The following object is masked from 'package:datasets':
#>
#> trees
data(quercus)
colnames(quercus)
#> [1] "species" "bio1" "bio10"
#> [4] "bio11" "bio12" "bio13"
#> [7] "bio14" "bio15" "bio16"
#> [10] "bio17" "bio18" "bio19"
#> [13] "bio2" "bio3" "bio4"
#> [16] "bio5" "bio6" "bio7"
#> [19] "topographic_diversity" "human_footprint" "landcover_veg_bare"
#> [22] "landcover_veg_herb" "landcover_veg_tree" "ndvi_average"
#> [25] "ndvi_maximum" "ndvi_minimum" "ndvi_range"
#> [28] "sun_rad_average" "sun_rad_maximum" "sun_rad_minimum"
#> [31] "sun_rad_range" "topo_slope" "geometry"Datasets
The table below summarizes the sf dataframes currently available in spatialData:
| Dataset | Description | Spatial scope | Temporal scope | Rows | Responses | Predictors | CRS | Geometry |
|---|---|---|---|---|---|---|---|---|
andalusia |
Plant presences and environmental predictors | Andalusia, Spain | 2000 - 2010 | 46,465 | 2 | 20 | EPSG:25830 | POINT |
communities |
Plant communities | Sierra Nevada, SE Spain | 2009 | 7,300 | 6 | 9 | EPSG:25830 | POINT |
interaction |
Butterfly & host plant | Sierra Nevada, SE Spain | 2014 | 1,000 | 3 | 10 | EPSG:25830 | POINT |
linaria |
Linaria nigricans vs. greenhouses | Eastern Andalusia, Spain | 7,386 | 2 | 20 | EPSG:25830 | POINT | |
neanderthal |
Neanderthals during MIS 5e | Europe | ~120,000 BP (MIS 5e) | 245 | 1 | 25 | EPSG:4326 | POINT |
plantae |
Plant diversity of the World’s Ecoregions | Global | 2020 | 662 | 53 | 84 | EPSG:4326 | POINT (centroids) |
quercus |
European oaks | Europe | present | 6,728 | 1 | 31 | EPSG:4326 | POINT |
trees |
Tree richness in Mesoamerica | Americas | 2012 | 3,373 | 1 | 50 | EPSG:4326 | POLYGON |
vi |
Global NDVI records | Global | 1999–2019 | 9,265 | 5 | 58 | EPSG:4326 | POINT |
Extra Data
Several datasets ship with companion download functions that retrieve larger or complementary files from spatialDataExtra.
| Dataset | Function | Description | Format | Geometry / Bands | Resolution | CRS |
|---|---|---|---|---|---|---|
andalusia |
andalusia_extra() |
Environmental predictors | GeoTIFF | 20 bands | 400 m | EPSG:25830 |
communities |
communities_extra_2010() |
Baseline predictors (2010) | GeoTIFF | 9 bands | 100 m | EPSG:25830 |
communities |
communities_extra_2050() |
Projected predictors (2050) | GeoTIFF | 9 bands | 100 m | EPSG:25830 |
communities |
communities_extra_2100() |
Projected predictors (2100) | GeoTIFF | 9 bands | 100 m | EPSG:25830 |
interaction |
interaction_extra() |
Environmental predictors | GeoTIFF | 10 bands | 100 m | EPSG:25830 |
linaria |
linaria_extra() |
Environmental predictors | GeoTIFF | 20 bands | 400 m | EPSG:25830 |
neanderthal |
neanderthal_extra() |
Palaeoclimate and topographic predictors | GeoTIFF | 25 bands | 0.18° | EPSG:4326 |
plantae |
plantae_extra() |
Ecoregion polygons with full diversity data | GeoPackage | MULTIPOLYGON | 662 features | EPSG:4326 |
quercus |
quercus_extra() |
Environmental predictors | GeoTIFF | 31 bands | 0.167° | EPSG:4326 |
trees |
trees_extra() |
Individual tree species presence points | GeoPackage | POINT | 523,308 rows | EPSG:4326 |
vi |
vi_extra() |
Extended NDVI dataset (30,000 records) | GeoPackage | POINT | 30,000 rows | EPSG:4326 |
License
CC BY 4.0 — see LICENSE.md for details.
Citation
The license of spatialData requires the following citation:
citation("spatialData")
#> To cite package 'spatialData' in publications use:
#>
#> Benito B (2025). "spatialData: Spatial Datasets for Ecological
#> Modeling." doi:10.5281/zenodo.19508673
#> <https://doi.org/10.5281/zenodo.19508673>, R package version 1.0.0,
#> <https://blasbenito.github.io/spatialData/>.
#>
#> A BibTeX entry for LaTeX users is
#>
#> @Misc{,
#> title = {spatialData: Spatial Datasets for Ecological Modeling},
#> author = {Blas M. Benito},
#> year = {2025},
#> note = {R package version 1.0.0},
#> url = {https://blasbenito.github.io/spatialData/},
#> doi = {10.5281/zenodo.19508673},
#> }Several datasets were sourced from research paper and require their own citations as well:
andalusia
- Benito, B.M., Lorite, J., Pérez-Pérez, R., Gómez-Aparicio, L., & Peñas, J. (2014). Forecasting plant range collapse in a mediterranean hotspot: when dispersal uncertainties matter. Diversity and Distributions, 20(1), 72–83. https://doi.org/10.1111/ddi.12148
communities
- Benito, B., Lorite, J., & Peñas, J. (2011). Simulating potential effects of climatic warming on altitudinal patterns of key species in Mediterranean-alpine ecosystems. Climatic Change, 108, 471–483. https://doi.org/10.1007/s10584-010-0015-3
interaction
- Barea-Azcón, J.M., Benito, B.M., Olivares, F.J., Ruiz, H., Martín, J., García, A.L., & López, R. (2014). Distribution and conservation of the relict interaction between the butterfly Agriades zullichi and its larval foodplant (Androsace vitaliana nevadensis). Biodiversity and Conservation, 23(4), 927–944. https://doi.org/10.1007/s10531-014-0643-4
linaria
Benito, B.M., Martínez-Ortega, M.M., Munoz, L.M., Lorite, J. & Penas, J. (2009). Assessing extinction-risk of endangered plants using species distribution models: a case study of habitat depletion caused by the spread of greenhouses. Biodiversity and Conservation, 18(9), 2509–2520. https://doi.org/10.1007/s10531-009-9604-8
Peñas, J., Benito, B., Lorite, J., et al. (2011). Habitat fragmentation in arid zones: a case study of Linaria nigricans under land use changes (SE Spain). Environmental Management, 48, 168–176. https://doi.org/10.1007/s00267-011-9663-y
Benito, B.P.d., Peñas, J.G.d. (2008). Greenhouses, land use change, and predictive models: MaxEnt and Geomod working together. In: Paegelow, M., Olmedo, M.T.C. (eds) Modelling Environmental Dynamics. Environmental Science and Engineering. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-68498-5_11
neanderthal
Benito, B.M., et al. (2017). The ecological niche and distribution of Neanderthals during the Last Interglacial. Journal of Biogeography, 44, 51–61. https://doi.org/10.1111/jbi.12845
Nielsen, T.K., Benito, B.M., Svenning, J.-C., Sandel, B., McKerracher, L., Riede, F., & Kjærgaard, P.C. (2017). Investigating Neanderthal dispersal above 55°N in Europe during the Last Interglacial Complex. Quaternary International, 431, 88–103. https://doi.org/10.1016/j.quaint.2015.10.039
plantae
- Maestre, F.T., Benito, B.M., Berdugo, M., et al. (2021). Biogeography of global drylands. New Phytologist, 231(2), 540–558. https://doi.org/10.1111/nph.17395
trees
Benito, B.M., Cayuela, L., & Albuquerque, F.S. (2013). The impact of modelling choices in the predictive performance of richness maps derived from species-distribution models. Methods in Ecology and Evolution, 4(4), 327–335. https://doi.org/10.1111/2041-210X.12022
Cayuela, L., Gálvez-Bravo, L., Pérez Pérez, R., de Albuquerque, F.S., Golicher, D.J., Zahawi, R.A., et al. (2012). The Tree Biodiversity Network (BIOTREE-NET): prospects for biodiversity research and conservation in the Neotropics. Biodiversity & Ecology, 4, 211–224. https://doi.org/10.7809/b-e.00078
