# Example data
print(sailor_students)
# Clean all character columns, replacing unwanted characters with "#", retaining "-"
sailor_students_cleaned <-
purge_string(sailor_students, sgic, school, class, gender, keep = "-")
# Tibble with cleaned 'sgic', 'school', 'class' and 'gender' columns
print(sailor_students_cleaned)
Run the code above in your browser using DataLab