standard_names: Standard Column Names

Description Usage Arguments Details Value Examples

View source: R/standard_names.R

Description

Standardizes column names 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_names(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 column names.

Examples

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

## End(Not run)

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