Description Usage Arguments Details Value See Also Examples
Provides a method for applying both cleaning functions (clean_x and clean_case) to a dataframe by index.
1 |
data |
is a data.frame containing any number of columns. |
cols |
is a list of integers or column names indicating the columns that are to be cleaned up. |
FUN |
is a list of functions to pass to the specified columns (must be in same order as the column index) |
This function is meant to be used on multiple columns at once. It makes use of the magrittr pipe operator to provide neat code.
Returns a dataframe with replacements in the specified columns
clean_x, clean_case
1 2 3 4 5 6 7 | df <- data.frame(pbnum = c("PB123", "PB 0034", " 5678 ", "None"),
status = c("Active", "Closed", "Closed", "Active"),
xnum = c("X00123", "9512", "X789", "NOT IN APS"))
#' df %>% clean_id(cols = c(1,3), FUN = c("clean_case", "clean_x"))
#' clean_id(data = df, cols = c(1,3), FUN = c("clean_case", "clean_x"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.