View source: R/Tidy_names_types_factors.R
apply_data_dictionary | R Documentation |
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
apply_data_dictionary(
data,
data_dictionary,
na_action_default = "keep_NA",
print_coerced_NA = TRUE
)
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. |
clean data.frame
J. Peter Marquardt
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.