is_syntactically_valid_name {atable}R Documentation

Checks if valid name

Description

Checks for valid names by make.names, i.e. x is valid iff make.names does nothing with x.

Usage

is_syntactically_valid_name(x)

Arguments

x

An object.

Value

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.

Examples

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

[Package atable version 0.1.10 Index]