What are the requirements for naming variables in R?

  • A variable name can be a combination of letters, digits, dots, and underscores. It can’t contain any other symbols, including white spaces.
  • A variable name must start with a letter or a dot.
  • If a variable name starts with a dot, this dot can’t be followed by a digit.
  • Reserved words in R (TRUEforNULL, etc.) can’t be used as variable names.
  • Variable names are case-sensitive.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *