tidyhwsd

tidyhwsd logo

Tidyverse-friendly access to the Harmonized World Soil Database (HWSD) v2.0.

Website: https://rimagination.github.io/tidyhwsd

Installation

install.packages("remotes")
remotes::install_github("Rimagination/tidyhwsd")

Minimal example

library(tidyhwsd)

# Download the HWSD index grid once
hwsd_download(ws_path = "D:/data/HWSD2", verbose = TRUE)

# Dominant-component values (default)
pt <- hwsd_extract(
  coords = c(110, 40),
  param = c("SAND", "PH_WATER"),
  layer = "D1",
  ws_path = "D:/data/HWSD2"
)

# Share-weighted synthesis (use hwsd_compose)
props <- hwsd_props()
pt_syn <- hwsd_compose(
  coords = c(110, 40),
  param = c("SAND", "PH_WATER"),
  layer = "D1",
  ws_path = "D:/data/HWSD2",
  props = props
)

Notes