Fix Down Loaded Names

Share:

Description

Fix names to remove problematic alphanumeric characters like spaces, quotes

Usage

1
fix.names(nam,  upper=FALSE, lower=FALSE)

Arguments

nam

string

upper

logical, TRUE= convert to upper case

lower

logical, TRUE= convert to lower case

Details

Currently only space, single and double quotes.

Value

string, with quaote replaced with underscore

Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
####  examples with embedded quotes are not available
####    because they interfere with R documentation

LAM = "SILENCED LAMB"
fix.names(LAM, lower=TRUE)

LAM = "Silence my Lamb"
fix.names(LAM, upper=TRUE)

LAM = "SILeNCED LAMB"
fix.names(LAM)

###   try with single quote
LAM = "O'brian LAMB"
fix.names(LAM)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.