Get Official Series Description Data from JSON, HTML or TXT sources
get_OSD(
series,
base_url = NULL,
result = c("json", "html", "txt"),
fix_ocr_errors = FALSE,
verbose = FALSE
)get_OSD_JSON(series, base_url = NULL)
For JSON result: A data.frame
with 1 row per series, and 1 column per "section" in the OSD as defined in National Soil Survey Handbook. For TXT or HTML result a list of character vectors containing OSD text with 1 element per series and one value per line.
A character vector of Official Series names e.g. "Chewacla"
Optional: alternate JSON/HTML/TXT repository path. Default: NULL
uses "https://github.com/ncss-tech/SoilKnowledgeBase"
for result="json"
Select "json"
, "html"
, or "txt"
output
Default: FALSE
; Applies only to result='json'
. Convert clear cases of Optical Character Recognition (OCR) errors to likely actual values.
Print errors and warning messages related to HTTP requests? Default: FALSE
The default base_url
for result="json"
is to JSON files stored in a GitHub repository that is regularly updated from the official source of Series Descriptions. Using format: https://raw.githubusercontent.com/ncss-tech/SoilKnowledgeBase/main/inst/extdata/OSD/{LETTER}/{SERIES}.json
for JSON. And "https://soilseriesdesc.sc.egov.usda.gov/OSD_Docs/{LETTER}/{SERIES}.html
is for result="html"
(official source).
fix_ocr_errors
by default is turned off (FALSE
). When TRUE
, assume that in color data hue/value/chroma lowercase "L" ("l"
) is a 1, and a capital "O" is interpreted as zero. Also, in horizon designations assume lowercase "L" is a 1
, and a string that starts with 0
starts with the capital letter "O"
.
# \donttest{
series <- c("Musick", "Hector", "Chewacla")
get_OSD(series)
# }
Run the code above in your browser using DataLab