View source: R/is_syntactically_valid_name.R
| is_syntactically_valid_name | R Documentation |
Checks for valid names by make.names,
i.e. x is valid iff make.names does nothing with x.
is_syntactically_valid_name(x)
x |
An object. |
A logical with length 1. TRUE when x is a character with length > 0 without duplicates
and is valid. Else FALSE and a warning what's wrong.
x <- c('asdf', NA,'.na', '<y', 'asdf', 'asdf.1')
is_syntactically_valid_name(x)
is_syntactically_valid_name(x[FALSE]) # FALSE because empty
is_syntactically_valid_name(NA) # FALSE because not character
is_syntactically_valid_name(as.character(NA)) # FALSE because NA
is_syntactically_valid_name('NA') # FALSE. make.names changes 'NA' to 'NA.'
is_syntactically_valid_name(letters) # TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.