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.
Read Also
Keywords in CReserved 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?reservedat 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,nextandbreakare used for conditions, loops and user defined functions. - They form the basic building blocks of programming in R.
TRUEandFALSEare the logical constants in R.NULLrepresents the absence of a value or an undefined value.Infis for "Infinity", for example when 1 is divided by 0.-
NaNis for "Not a Number", for example when 0 is divided by 0. NAstands for "Not Available" and is used to represent missing values.Ris a case sensitive language Which mean that TRUE and True are not the same.
> TRUE <- 1
Errorin TRUE <- 1 : invalid (do_set) left-hand side to assignment
>True<- 1
> TRUE
[1] TRUE
>True
[1] 1