pipe_nice_names: Format variable names into standard format in a pipe.

View source: R/nice_utilities.R

pipe_nice_namesR Documentation

Format variable names into standard format in a pipe.

Description

Turns column names of data frames into standardised format. Dots are replaced with underscores, trailing underscores are removed and everything is made lower case. Punctuation and spaces are also replaced by underscores and double underscores are removed last

Usage

pipe_nice_names(x)

Arguments

x

A data frame

Value

A data frame with nicely formatted names

Examples

## Not run: 
data(mtcars)
names(mtcars) <- toupper(names(mtcars))
mtcars %>% pipe_nice_names()

## End(Not run)

simonthelwall/nicethings documentation built on Feb. 27, 2023, 3:15 p.m.