
Fetch USGS National Geochemical Database soil geochemistry
Source:R/taphonomy.R
morie_taphonomy_fetch_usgs_soil.RdDownloads the U.S. Geological Survey National Geochemical Database (soil)
bulk CSV – real, open elemental concentrations (Ca, Fe, ...) that
are the compositional analogue of pXRF bone/relic spectra. Use it to
calibrate the compositional pipeline (morie_taphonomy_clr /
morie_taphonomy_ilr / DML) on genuine open data before real
scans exist. Dependency-free: the CSV is read straight from the zip with base
R (no GDAL/sf); the WFS endpoint is GML-only and deliberately not used.
Usage
morie_taphonomy_fetch_usgs_soil(
dest = tempdir(),
nrows = 1000L,
url = .MORIE_USGS_NGDBSOIL_URL,
refresh = FALSE
)Arguments
- dest
Cache directory for the zip (default
tempdir(); never~).- nrows
Rows to read (default 1000 for a quick slice;
NULL= all 1.5M+).- url
Source URL (default the USGS NGDB soil zip).
- refresh
Re-download even if the cached zip exists.
Value
A data.frame of soil samples with elemental-concentration
columns; attr(., "source") records the URL.
Details
The download is ~54 MB (482 MB uncompressed); it is cached in dest and
reused unless refresh = TRUE. Network + size mean this never runs in
examples/tests.