View source: R/epi_clean_make_names.R
epi_clean_make_names | R Documentation |
epi_clean_make_names() Pass a string vector such as column headers, check they are valid names and if not correct. Saves some headaches downstream when trying to plot non-syntactically valid column headers for example.
epi_clean_make_names(string = "", str_replacement = "_", unique = TRUE)
string |
String with names to test |
str_replacement |
string to use instead of the '.' from make.names() Default is '_'. |
unique |
make.names() unique parameter. Default is TRUE. |
A list of corrected and valid strings.
Antonio Berlanga-Taylor <\url{https://github.com/AntonioJBT/episcout}>
make.names
,
stackoverflow test if valid,
r-bloggers test valid names.
## Not run:
library(stringr)
string <- c('mean', '.j_j', '...', 'if',
'while', 'TRUE', 'NULL', '_jj',
' j', '.2way')
valid_names <- epi_clean_make_names(string)
valid_names
epi_clean_make_names(valid_names) # There shouldn't be anything to correct
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.