strip_non_alpha: strip_non_alpha

Description Usage Arguments Value Examples

View source: R/strip_non_alpha.R

Description

Strip out most non-alphanumeric characters from variables. Removes all alphanumeric characters except for periods and underscores ('.' and '_'), as these are often used in variable names.

Usage

1

Arguments

df

The dataframe, tibble, etc, with the variables you want to tidy.

Value

A dataframe, tibble, etc, with new and consistent cases for variable names.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 

names(df)
#[1] "name_with_brackets[]"                "$$name_with_dollar_sign"            
#[3] "name_&&with&&_ambersand::_and_colon" "name_'with\"_quote" 

df <- strip_non_alpha(df)

names(df)
#[1] "name_with_brackets"             "name_with_dollar_sign"    
#[2] "name_with_ambersand_and_colon"  "name_with_quote" 


## End(Not run)

evanodell/emisc documentation built on May 30, 2019, 8:28 a.m.