[!NOTE] PRIOGRID v.3.0.1 is an unstable Alpha release. We will be releasing a Beta version shortly.
An R-package for collecting and standardizing open spatial data into a common grid format.
Resources: - R-package repository - Documentation - Suggest data sources and variables, or report issues - Download PRIOGRID data as .zip
What’s New in PRIOGRID v.3.x
- Better metadata handling — Stores information about data licenses, citations, and download URLs. Automatically downloads data and handles local data with user-specified options.
-
R, not SQL — More researchers know R, and the package leverages excellent spatial-data infrastructure with
sf,terra, andexactextractr. - Flexible spatio-temporal configuration — Change resolution, extent, and projection to test the modifiable areal unit problem or create tailored datasets (e.g., area-equal projections for polar regions).
- PRIOGRID is a research tool, not just a dataset.
-
Efficient, self-describing outputs — Variables ship as Cloud-Optimized GeoTIFFs and time-varying tables as Hive-partitioned Parquet, so
read_pg_timevarying()pushes year/date/cell/variable filters down to Arrow before loading.
Installation
Install PRIOGRID from GitHub using remotes or renv:
install.packages("renv")
renv::install("prio-data/priogrid")Optional R Packages
terra, sf, and exactextractr are listed in Suggests and are not installed automatically. They are only required for spatial functionality (working with rasters, and extent-based subsetting) and will be requested the first time you use a function that needs them.
Troubleshooting Installation
terra, sf, and exactextractr depend on system-level geo-libraries. If installation of these packages fails, refer to their installation guides:
If you continue to experience issues after following these guides, please file an issue.
SSL Certificate Issues
If you encounter SSL certificate errors when downloading data, try:
- Install system certificates:
Mac (Homebrew users):
Linux (Ubuntu/Debian):
- Install CURL R-package from source:
install.packages("curl", type = "source")Getting Started
Set a local folder for PRIOGRID to store downloaded and processed data (this persists across R sessions):
library(priogrid)
pg_set_rawfolder("/path/to/your/data/folder")Download the official release and read it into R:
download_priogrid()
pg_static <- read_pg_static()
pg_timevarying <- read_pg_timevarying()Load only the rows and columns you need — filters push down to Arrow before anything is collected:
pg_sub <- read_pg_timevarying(
years = 2010:2015,
extent = c(xmin = -20, xmax = 55, ymin = -35, ymax = 40),
variables = "cru_tmp"
)Browse available variables:
pgvariablesDocumentation
Full documentation is available in the package vignettes:
| Vignette | Description |
|---|---|
| Getting Started | Setup, downloading, and reading tabular data |
| Accessing as Rasters | Working with individual variables using terra
|
| Citations and Bibliography | Citing data providers in publications |
| Custom Configurations | Custom resolution, extent, projection, and time periods |
| Understanding Metadata | Exploring pgsources, pgvariables, and pgsearch()
|
| Contributing | Adding new data sources and variables |
Contributing
We welcome contributions. Report issues or suggest new data sources or variable ideas using our Issue Tracker.
Please see our contribution guidelines for details on how you can contribute with code.