Learn R Programming

teal.slice (version 0.5.1)

check_simple_name: Test whether variable name can be used within Show R Code

Description

Variable names containing spaces are problematic and must be wrapped in backticks. Also, they should not start with a number as R may silently make it valid by changing it. Therefore, we only allow alphanumeric characters with underscores. The first character of the name must be an alphabetic character and can be followed by alphanumeric characters.

Usage

check_simple_name(name)

Value

Returns NULL or raises error.

Arguments

name

(character) vector of names to check