Learn R Programming

lares (version 5.0.3)

cleanNames: Clean title names of a data.frame/tibble object

Description

Resulting names are unique and consist only of the _ character, numbers, and ASCII letters. Capitalization preferences can be specified using the lower parameter. Inspired by janitor::clean_names.

Usage

cleanNames(df, num = "x", ...)

Arguments

df

data.frame/tibble

num

Add character before only-numeric names

...

Additional parameters passed to cleanText

Value

Character vector with transformed strings.

See Also

Other Text Mining: cleanText(), ngrams(), remove_stopwords(), replaceall(), sentimentBreakdown(), textCloud(), textFeats(), textTokenizer(), topics_rake()

Examples

Run this code
# NOT RUN {
df <- dft[1:5, 1:6] # Dummy data
colnames(df) <- c("ID.", "34", "x_2", "Num 123", "N<U+00F2>n-<U+00E4>sc<U+00EC>", "  white   Spaces  ")
print(df)
cleanNames(df)
cleanNames(df, lower = FALSE)
# }

Run the code above in your browser using DataLab