powered by
This function removes non-alphanumeric characters from all non-numeric columns in a data frame. The columns are modified in-place.
fix_special_characters_in_data(df)
A modified data frame where all non-numeric columns have had non-alphanumeric characters removed.
A data frame.
df <- data.frame(a = c("A*B", "C&D"), b = c("1.2", "3.4")) fix_special_characters_in_data(df) # Output: # a b # 1 AB 1.2 # 2 CD 3.4
Run the code above in your browser using DataLab