standard_char: Standardize Character Column Strings

Description Usage Arguments Details Value Examples

View source: R/standard_char.R

Description

Standardizes all character column strings by converting the strings to lowercase, removing white space, and removing all non-alphanumeric characters and replacing them with a specified character.

Usage

1
2
standard_char(x, remove.non.alphanumeric.char = TRUE,
  replacement.char = "_")

Arguments

x

A data frame or tibble.

remove.non.alphanumeric.char

If FALSE, all non-alphanumeric characters will be unaltered. If TRUE, all non-alphanumeric characters will be replaced by a specified character. Default: TRUE

replacement.char

The character(s) used to replace all of the non-alphanumeric characters., Default: '_'

Details

DETAILS

Value

A data fram with standardized character columns.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
if(interactive()){
 data("starwars")
 test.df <- head(starwars)
 standard_char(test.df)
 standard_char(test.df, replacement.char = "+")
 }

## End(Not run)

zsmith27/toolbox documentation built on May 4, 2019, 8:43 a.m.