This package contains a mish-mash of functionality and sample data related to the daily business of soil survey operations with the USDA-NRCS. Many of the functions are highly specialized and inherit default arguments from the names used by the various NCSS (National Cooperative Soil Survey) databases.

Installation

Get the stable version from CRAN:

install.packages('sharpshootR', dep = TRUE)

Get the development version from Github, after installing the CRAN version + dependencies:

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

Install Suggested Packages

p <- c("MASS", "spdep", "circlize", "rvest", "xml2", "terra", 
       "raster", "exactextractr", "httr", "jsonlite", "igraph", 
       "dendextend", "testthat", "hydromad", "latticeExtra", 
       "farver", "venn", "gower", "daymetr", "elevatr", 
       "Evapotranspiration", "zoo", "SoilTaxonomy", "sf", "Hmisc"
)

install.packages(p)

Examples

library(sharpshootR)
library(aqp)
data(loafercreek, package = 'soilDB')

# generalize horizon names using REGEX rules
n <- c('Oi', 'A', 'BA','Bt1','Bt2','Bt3','Cr','R')
p <- c('O', '^A$|Ad|Ap|AB','BA$|Bw', 
       'Bt1$|^B$','^Bt$|^Bt2$','^Bt3|^Bt4|CBt$|BCt$|2Bt|2CB$|^C$','Cr','R')
loafercreek$genhz <- generalize.hz(loafercreek$hzname, n, p)

# remove non-matching generalized horizon names
loafercreek$genhz[loafercreek$genhz == 'not-used'] <- NA
loafercreek$genhz <- factor(loafercreek$genhz)

# aggregate color data, this function is from the `aqp` package
a <- aggregateColor(loafercreek, 'genhz', k = 8)

# plot
par(mar=c(4.5, 1.25, 1, 0.25))
aggregateColorPlot(a, print.n.hz = TRUE)

Citation

citation("sharpshootR")
#> 
#> To cite package 'sharpshootR' in publications use:
#> 
#>   Beaudette D, Skovlin J, Roecker S, Brown A (2023). _sharpshootR: A
#>   Soil Survey Toolkit_. R package version 2.2,
#>   <https://CRAN.R-project.org/package=sharpshootR>.
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Manual{,
#>     title = {sharpshootR: A Soil Survey Toolkit},
#>     author = {Dylan Beaudette and Jay Skovlin and Stephen Roecker and Andrew Brown},
#>     year = {2023},
#>     note = {R package version 2.2},
#>     url = {https://CRAN.R-project.org/package=sharpshootR},
#>   }