Reserved words | Reserved words - r - learn r - r programming



  • Reserved words in R programming are a set of words that have special meaning and cannot be used as an identifier (variable name, function name etc.).
  • Here is a list of reserved words in the R's parser.
 reserved word

Read Also

Keywords in C

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_ ...
  • This list can be viewed by typing help(reserved) or ?reserved at the R command prompt as follows.
> ?reserved
  • A logical constant in R, which can be used a variable.
  • Among these words, if, else, repeat, while, function, for, in, next and break are used for conditions, loops and user defined functions.
  • They form the basic building blocks of programming in R.
  • TRUE and FALSE are the logical constants in R.
  • NULL represents the absence of a value or an undefined value.
  • Inf is for "Infinity", for example when 1 is divided by 0.
  • NaN is for "Not a Number", for example when 0 is divided by 0.
  • NA stands for "Not Available" and is used to represent missing values.
  • R is a case sensitive language Which mean that TRUE and True are not the same.
r programming reserved words
> TRUE <- 1
Errorin TRUE <- 1 : invalid (do_set) left-hand side to assignment

>True<- 1

> TRUE
[1] TRUE

>True
[1] 1

Related Searches to Reserved words | Reserved words