Describes columns of a data table (classes, units, datetime formats, missing value codes).
template_table_attributes(
path,
data.path = path,
data.table = NULL,
write.file = TRUE,
x = NULL
)
(character) Path to the metadata template directory.
(character) Path to the data directory.
(character) Table name. If more than one, then supply as a
vector of character strings (e.g.
data.table = c('nitrogen.csv', 'decomp.csv')
).
(logical; optional) Whether to write the template file.
(named list; optional) Alternative input to
template_table_attributes()
. Use template_arguments()
to create x
.
Columns:
attributeName: Column name
attributeDefinition: Column definition
class: Column class. Valid options are: "numeric" (Numeric variable), "categorical" (Categorical variable, i.e. nominal), "character" (Free text character strings, e.g. notes), "Date" (Date and time variable)
unit: Column unit. Required for numeric classes. Select from EML's standard unit dictionary, accessible with view_unit_dictionary()
. Use values in the "id" column. If not found, then define as a custom unit (see custom_units.txt).
dateTimeFormatString: Format string. Required for Date classes. Valid format string components are: "Y" (Year), "M" (Month), "D" (Day), "h" (Hour), "m" (Minute), "s" (Second), Common separators of format string components (e.g. "-" "/" "\" ":"") are supported.
missingValueCode: Missing value code. Required for columns containing a missing value code).
missingValueCodeExplanation: Definition of missing value code.
Describes non-standard units used in a data table attribute template. Columns:
id: Unit name listed in the unit column of the table attributes template (e.g. feetPerSecond)
unitType: Unit type (e.g. velocity)
parentSI: SI equivalent (e.g. metersPerSecond)
multiplierToSI: Multiplier to SI equivalent (e.g. 0.3048)
Abbreviation: Abbreviation (e.g. ft/s)
Character encoding of metadata extracted directly from the tables are
converted to UTF-8 via enc2utf8()
.