These functions convert the coded values returned from NASIS into their
plain text representation. It duplicates the functionality of the CODELABEL
function found in NASIS. This function is primarily intended to be used
internally by other soilDB R functions, in order to minimizes the need to
manually convert values.
The function works by iterating through the column names in a data frame and
looking up whether they match any of the ColumnPhysicalNames found in the
metadata domain tables. If matches are found then the columns coded values
are converted to their corresponding factor levels. Therefore it is not
advisable to reuse column names from NASIS unless the contents match the
range of values and format found in NASIS. Otherwise uncode() will convert
their values to NA.
When data is being imported from NASIS, the metadata tables are sourced
directly from NASIS. When data is being imported from SDA or the NASIS Web
Reports, the metadata is pulled from a static snapshot in the soilDB
package.
Set options(soilDB.NASIS.skip_uncode = TRUE)
to bypass decoding logic; for instance when using soilDB NASIS functions with custom NASIS snapshots that have already been decoded.