View source: R/clearning-helpers.R
rm_spl_char | R Documentation |
This function takes a data frame or a tibble object and a vector of columns, removing special
characters from the specified columns in the data frame or tibble. To be precise, the function
is implemented such that only the character class of numbers and letters in the current locale,
i.e., [:alnum:]
, and periods (".") are retained.
rm_spl_char(df, var)
df |
A data frame or tibble. |
var |
A character vector, with length no greater than |
An object of the same type as df
with specified columns stripped of their special characters.
col_nms_rm_spl_char()
for removing special characters from columns names.
# Remove special characters from columns 1 & 2 df_ %>% rm_spl_char(var = c("col_1", "col_2")) # Remove special characters from all columns cols <- names(df) df_ %>% rrm_spl_char(var = cols)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.