i

R Programming Complete Tutorial

R Variables

A variable provides us with named storage that our program can manipulate. To create a variable, we follow a guideline. In our code, we have to follow these rules strictly.

Rules for writing a variable:

1. Variables can be a combination of letters, digits, dot (.), and underscore (_).

2. It must start with a letter or a dot. If it begins with a dot, it cannot be followed by a digit.

3. Reserved words in R cannot be used as variables.

R reserved keywords:

In R programming, reserved words are a set of words that have a special meaning and cannot be used as an identifier. Here is a list of reserved words in the RS parser.

Among these words, if, else, repeat, while, function, for, in, next, break are used for conditions, loops, and user-defined functions. They are from the basic building blocks of R.TRUE and FALSE are the logical constants in R.Null represents an undefined or absence of value.Inf is used for infinity, and NA stands for Not Available.

It's only a small set of words. For the full list, we can use help(reverse) commands.