50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


ProfessR (version 2.1)

fix.names: Fix Down Loaded Names

Description

Fix names to remove problematic alphanumeric characters like spaces, quotes

Usage

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

Arguments

nam
string
upper
logical, TRUE= convert to upper case
lower
logical, TRUE= convert to lower case

Value

  • string, with quaote replaced with underscore

Details

Currently only space, single and double quotes.

Examples

Run this code
####  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)

Run the code above in your browser using DataLab