Clean strings so that they can be used as variable names or column names

clean_strings(string, treat_dups = TRUE)

Arguments

string

Character string to be "cleaned".

treat_dups

Set to FALSE to allow duplication of strings. Defaults to TRUE

Value

A "cleaned" string character vector.

Examples

clean_strings(c("Respondent ID","Q23. Brand Awareness"))
#> [1] "respondent_id"       "q23_brand_awareness"