
Remove special characters from a column in a dataframe
Source:R/clean_hces.R
remove_spec_char_v1.Rd
This function removes special characters from a specified column in a dataframe. It also adds a period after 'NO' if it is a whole word and not already followed by a period.
Examples
data <- data.frame(x = c("NO", "YES (maybe)", "NO (definitely)"))
remove_spec_char_v1(data, "x", FALSE)
#> x
#> 1 NO.
#> 2 YES -MAYBE
#> 3 NO. -DEFINITELY