Skip to contents

Checks if a character string is a valid R variable name using regular expressions.

Usage

validNames(...)

Arguments

...

(Required) A collection of character vectors to be checked

Value

None. The function is simply generates an error if an invalid name is passed to it.

Details

A valid R name starts with a letter or a dot followed by a non-numerical character and contains only letters, numbers and dots.

Author

Romain Francois

Examples


  # correct name
  validNames("DOSE")
#> [1] TRUE
  if (FALSE) {
    # wrong name
    validNames(".334fsedqw")
  }