apply_data_dictionary {basecamb} | R Documentation |
Clean column names, types and levels
Description
Use a data dictionary data.frame to apply the following tidying steps to your data.frame:
Remove superfluous columns
Rename columns
Ensure/coerce correct data type for each column
Assign factorial levels, including renaming and grouping
Usage
apply_data_dictionary(
data,
data_dictionary,
na_action_default = "keep_NA",
print_coerced_NA = TRUE
)
Arguments
data |
data.frame to be cleaned |
data_dictionary |
data.frame with the following columns:
|
na_action_default |
character: Specify what to do with NA values. Defaults to 'keep_NA'. Options are:
|
print_coerced_NA |
logical indicating whether a message specifying the location of NAs that are introduced by apply_data_dictionary() to data should be printed. |
Value
clean data.frame
Author(s)
J. Peter Marquardt