Search code examples
pythonrkeyword

Primitive keywords for R


What are the primitive keywords in R? For example, in Python del, assert, if, else and so on are all keywords. In R it seems only some of these are keywords, but some are rather functions from some (unknown) library, or some weird "syntax hacks", such as using df[-c(1),] to delete the first row of observations*. Here I found some of list, but I'm not sure if those aren't just basic functions, instead of primitive keywords.
Unfortunately the documentation of R is overwhelming and after spending some time with it, I was able to find such a list.


Solution

  • They can be seen by "typing help(reserved) or ?reserved at the R command prompt"(source).

    The full list, according to the above site as of posting, is:

    if, else, repeat, while, function, for, in, next, break, TRUE, FALSE, NULL, Inf, NaN, NA, NA_integer_, NA_real_, NA_complex_, NA_character_