clean: Clean punctuated headers and text variables

Description Usage Arguments Details

Description

Replace or drop UTF-8 characters and punctuation in headers or/and in char/factor variables.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
clean(x, keep = NULL, add_repl = NULL, ...)

## S3 method for class 'character'
clean(x, keep = NULL, add_repl = NULL)

## S3 method for class 'factor'
clean(x, keep = NULL, add_repl = NULL,
  byref = FALSE)

## S3 method for class 'data.frame'
clean(x, col_names = TRUE, vars = FALSE,
  keep = NULL, add_repl = NULL, byref = FALSE)

Arguments

x

chr, factor or data.frame.

keep

vector of characters to preserve

add_repl

named vector of additional replacements desired. Overrules keep and default replacements

...

additional parameters to factor and data.frame S3 methods. See details.

Details

For data.frame's, byref = TRUE allows to replace characters by reference.

Additionally, booleans col_names and vars indicate if replacements should take place in columns names and variables, respectively. By default, col_names = TRUE and vars = FALSE.


eric-krishna/DDMEutils documentation built on May 30, 2019, 2:09 p.m.