View source: R/clean_dataset.R
| clean_dataset | R Documentation |
Removes duplicate rows, standardizes column names and text values to uppercase or lowercase, and performs basic data cleaning on a data frame.
clean_dataset(
df,
variables = NULL,
remove_duplicates = TRUE,
convert_to_case = NULL
)
df |
A data frame to be cleaned. |
variables |
Optional; a vector of variable names to specifically clean. If NULL, applies cleaning to all variables. |
remove_duplicates |
Logical; whether to remove duplicate rows. |
convert_to_case |
Optional; convert character variables to "lower" or "upper" case. |
A cleaned data frame.
df <- data.frame(name = c("Alice", "Bob", "Alice"),
score = c(90, 85, 90),
stringsAsFactors = FALSE)
clean_dataset(df, remove_duplicates = TRUE, convert_to_case = "upper")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.