You are on page 1of 2

RESERVED WORDS IN “R”

Reserved words often used in programming languages and macros are terms or phrases
suitable for specific use and may not be used to construct variables names.
For example, “print” is a reserved term, since displaying text on the screen is a feature in
many languages.

“Reserved words in R programming” are a collection of words of special meaning and canoot
be used as identifiers.
If the developer uses the software of these words if will throw error and it won’t work. So, as
R programmer, you will know these reserved words first, and not use them to create
variables.

The following is a list of reserved words in R:

if else repeat while Function


For In next break True
FALSE NULL Inf NaN NA
NA_integer NA_real NA_complex NA_character

 A logical constant in R, that a variable can be used.


 Bewteen those words, if, otherwise, repeat while, function, for conditions, loops, and
user- defined functions are used for , in , next and split.

 They form the underlying programming blocks in R.

 Logical constants in R are TRUE and FALSE.

 NULL represents a number of unknown number that is not present.

 Inf is for “infinity” e.g if 0 divides 1.

 NaN is for “not a number” e.g if 0 is divided by 0.


 NA stands for “Not Accessible” and is used to denote missing values.

 R is a case sensitive language which means that TRUE is not the same as True.

For e.g:

> TRUE <- 1

Error in TRUE <- 1 : invalid (do_set) left-hand side to assignment

> True <- 1

> TRUE

[1] TRUE

> True

[1] 1

You might also like