Read data tables of a data package from the EML metadata.

read_tables(
  eml,
  strip.white = FALSE,
  na.strings = NULL,
  convert.missing.value = NULL,
  add.units = FALSE
)

Arguments

eml

(xml_document, xml_node) EML metadata returned from read_eml().

strip.white

(logical) Strips leading and trailing whitespaces of unquoted fields. Default if FALSE.

na.strings

(character) Strings to be interpreted as NA. Setting na.strings = "" converts "" to NA. By default, blank strings "" are read as is.

convert.missing.value

(logical) Converts all missing value codes specified in eml (e.g. "-99999", "NaN", "Not measured") to NA. Missing value codes vary across data packages and converting to a consistent form recognized by R makes downstream use simpler. However, care must be exercised when using this argument. The author of a dataset described by eml may have defined "missing value code" to mean something different than you expect (e.g. "below detection limit") therefore reviewing the authors missing value code definitions is a good idea. Default is FALSE.

add.units

(logical) If TRUE, a variable's unit of measurement will be added to the table in a separate column with a column name of the form: <unit>_<variable_name>. This argument is useful when gathering variables into a long (attribute-value) table.

Value

(list) List of named data frames

Details

This function uses data.table::fread() and uses default argument values if the EML based values return an error.

Default settings preserve the form the data were originally published in.

Examples