spatialData is a data-only R package providing ready-to-use spatial datasets for ecological modeling. It was originally developed to supply example data for the R packages collinear and spatialRF, but the datasets are equally suited for teaching spatial analysis and species distribution modeling. Each dataset comes pre-processed with response variables and environmental predictors, so you can jump straight into the analysis without spending time on data preparation.
Installation
Install the development version from GitHub:
# Option 1: pak (recommended)
# install.packages("pak")
pak::pkg_install("blasbenito/spatialData")
# Option 2: remotes
# install.packages("remotes")
remotes::install_github("blasbenito/spatialData")Datasets
All datasets are loaded lazily via data(). Most are sf data frames with point or polygon geometries; interaction is a plain data frame.
| Dataset | Description | Spatial scope | Temporal scope | Rows | Responses | Predictors | CRS | Geometry |
|---|---|---|---|---|---|---|---|---|
neanderthal |
Neanderthal presence/absence and paleoclimate predictors | Europe | ~120,000 BP (MIS 5e) | 245 | 1 | 25 | EPSG:4326 | POINT |
quercus |
Distribution of European oaks and bioglimatic predictors | Europe | present | 6,728 | 1 | 31 | EPSG:4326 | POINT |
vi |
NDVI records with environmental predictors | Global | 1999–2019 | 9,265 | 5 | 58 | EPSG:4326 | POINT |
plantae |
Plant diversity of the global ecoregions | Global | 2020 | 662 | 53 | 84 | EPSG:4326 | POINT (centroids) |
trees |
Tree species richness and environmental predictors | Americas | 2012 | 3,373 | 1 | 50 | EPSG:4326 | POLYGON |
communities |
Plant community presence and climate predictors | Sierra Nevada, SE Spain | 2009 | 7,300 | 6 | 9 | EPSG:25830 | POINT |
interaction |
Butterfly and host plant presence and environmental predictors | Sierra Nevada, SE Spain | 2014 | 1000 | 3 | 10 | EPSG:25830 | POINT |
linaria |
Linaria nigricans and greenhouse records with environmental predictors | Eastern Andalusia, Spain | 7,386 | 2 | 20 | EPSG:25830 | POINT | |
andalusia |
Plant species presences and and environmental predictors | Andalusia, Spain | 2010 | 8,666 | 2 | 20 | EPSG:25830 | 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 |
|---|---|---|---|---|---|---|
neanderthal |
neanderthal_extra() |
25-band palaeoclimate raster (bioclim + topography) | GeoTIFF | 25 bands | 0.18° | EPSG:4326 |
quercus |
quercus_extra() |
31-band bioclimatic/environmental raster | GeoTIFF | 31 bands | 0.167° | EPSG:4326 |
vi |
vi_extra() |
Extended NDVI point dataset (30,000 records) | GeoPackage | POINT | 30,000 rows | EPSG:4326 |
plantae |
plantae_extra() |
Ecoregion polygons with full diversity data | GeoPackage | MULTIPOLYGON | 662 features | EPSG:4326 |
trees |
trees_extra() |
Individual tree species presence points | GeoPackage | POINT | 523,308 rows | EPSG:4326 |
communities |
communities_extra_2010() |
Baseline (2010) climate raster for Sierra Nevada | GeoTIFF | 9 bands | 100 m | EPSG:25830 |
communities |
communities_extra_2050() |
Projected (2050) climate raster for Sierra Nevada | GeoTIFF | 9 bands | 100 m | EPSG:25830 |
communities |
communities_extra_2100() |
Projected (2100) climate raster for Sierra Nevada | GeoTIFF | 9 bands | 100 m | EPSG:25830 |
interaction |
interaction_extra() |
10-band environmental raster for Sierra Nevada | GeoTIFF | 10 bands | 100 m | EPSG:25830 |
linaria |
linaria_extra() |
20-band environmental raster for Eastern Andalusia | GeoTIFF | 20 bands | 400 m | EPSG:25830 |
andalusia |
andalusia_extra() |
20-band environmental raster for Andalusia | GeoTIFF | 20 bands | 400 m | EPSG:25830 |
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.XXXXXXX
#> <https://doi.org/10.5281/zenodo.XXXXXXX>, R package version 0.0.1,
#> <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 0.0.1},
#> url = {https://blasbenito.github.io/spatialData},
#> doi = {10.5281/zenodo.XXXXXXX},
#> }License
CC BY 4.0 — see LICENSE.md for details.