Skip to contents

Clean column names by replacing all spaces and punctuation with a single underscore

Usage

clean_colnames(x)

Arguments

x

Character vector or matrix with colnames or any object with names() method.

Value

Character vector.

Author

EDG

Examples

clean_colnames(iris)
#> [1] "Sepal_Length" "Sepal_Width"  "Petal_Length" "Petal_Width"  "Species"