Standardize TROLL Data Column Names
TROLL_rename_cols.RdCleans, validates, and standardizes raw TROLL CSV column names into names used throughout the package.
Usage
TROLL_rename_cols(
df,
trollcomm_serials = trollCOMM_serials,
colname_dictionary = troll_column_dictionary,
strip_metadata = TRUE,
verbose = FALSE
)Arguments
- df
A data frame read from a raw TROLL CSV export.
- trollcomm_serials
A numeric vector of known TROLL-COM serial numbers. Defaults to the internal
trollCOMM_serialslookup.- colname_dictionary
Dataframe; default = `troll_column_dictionary`. Provided regex patterns and associated canonical naming schema for standardizing column names.
- strip_metadata
Logical; if
TRUE, removes metadata columns specified in the `troll_column_dictionary`.- verbose
Logical; if
TRUE, prints the final standardized column names to the console.
Details
The function performs the following steps:
Detects and renames TROLL-COM temperature columns.
Normalizes raw column names (removes serial numbers).
Applies the internal column names dictionary for validation and canonical renaming.
The function will stop execution if:
Unknown columns are detected,
Multiple columns map to the same canonical name,
Required columns are missing.