clean_names: Cleans names

Description Usage Arguments Details Value Examples

Description

Simple extension of the function [base::make.name()].

Usage

1
clean_names(names, sep = ".", replace.all = TRUE, is.valid = FALSE)

Arguments

names

character vector to be modified. This is coerced to character if necessary. First processed using base::make.name

sep

The string separator. Default is '.'.

replace.all

Logical. If TRUE (default) will replace multiple consecutive occurrences of the separator with a single instance.

is.valid

Not used. Logical. Test if the final character vector is syntactically valid.

Details

It will pass the input vector to it but allow the use of other separators other than '.'

Value

clean_name

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
some_col <- c(
   "I once",
   "got   some weird",
   "tables",
   "from.a.collaborator")

clean_names(some_col)
clean_names(some_col, replace.all=F, sep="_")
clean_names(some_col, sep="_")
clean_names(some_col, sep="+")

adomingues/cleaneRnames documentation built on May 11, 2019, 6:26 p.m.