Get the stable version from CRAN:

install.packages('soilDB', dependencies = TRUE)

Get the development version from GitHub:

remotes::install_github("ncss-tech/soilDB", dependencies = FALSE, upgrade = FALSE, build = FALSE)


Dylan Beaudette, Jay Skovlin, Stephen Roecker and Andrew Brown (2021). soilDB: Soil Database Interface. R package version 2.6.3.

soilDB 2.6.3

Notices on Database Interfaces


  • all NASIS queries now use {DBI}, tested to work with {odbc} or {RSQLite} drivers; replacing {RODBC}
  • new methods for connecting to NASIS and querying NASIS data allow for dsn argument to specify a local “static” SQLite file containing NASIS tables.
    • Default argument dsn = NULL uses "nasis_local" ODBC connection to a local NASIS SQL Server instance

Soil Data Access (SDA)

  • SDA_query returns a try-error for queries with invalid syntax or on network error; empty results are an empty data.frame()
  • fetchSDA_spatial can return STATSGO gsmmupolygon or Soil Survey Area sapolygon data; and can join to the legend table
  • Added several new SDA query methods based on ssurgoOnDemand by Jason Nemecek and Chad Ferguson:
  • get_SDA_property, get_SDA_interpretation, get_SDA_muaggatt, get_SDA_hydric, get_SDA_pmgroupname

MS Access

  • AKSite, Montana RangeDB, and PedonPC 6.x get and fetch methods now use {DBI}+{odbc}

SoilWeb API

  • ISSR800.wcs and mukey.wcs now return a result that inherits from try-error (and a message) if the Web Coverage Service fails

Functions by Data Source

Tutorials and Demonstrations


Load Soil Packages


Get Official Series Description Data

# get morphology + extended summaries
soils <- c('cecil', 'altavista', 'lloyd', 'wickham', 'woodbridge', 'chewacla', 'congaree')
s <- fetchOSD(soils, extended = TRUE)

Visualize Soil-Landscape Relationships

# viz of hillslope position, from SSURGO component records
res <- vizHillslopePosition(s$hillpos, annotation.cex = 0.9)

Make Profile Sketches

par(mar = c(0, 1, 0, 4), xpd = NA)

  plot.order = res$order,
  cex.names = 1,
  axis.line.offset = -0.1,
  width = 0.2

Identify Tabular “Siblings”

s <- 'Amador'
amador <- siblings(s, only.major = FALSE, = TRUE)

# limit to named soil series <- subset(amador$, !compkind %in% c('Miscellaneous area', 'Family', 'Taxon above family'))

# get parsed OSD records
sibs <- fetchOSD(c(s, unique(amador$sib$sibling)), extended = TRUE)

Plot Dendrograms with Taxonomic Relationships

# invert colors
par(mar = c(0, 0, 0, 0),
    fg = 'white',
    bg = 'black')

  dend.width = 1.5,
  y.offset = 0.4,
  scaling.factor = 0.02,
  width = 0.2,
  cex.taxon.labels = 1,
  cex.names = 1

Dependency Graph