Chapter 6. R Syntax

This chapter contains an overview of R syntax. It’s not intended to be a formal or complete description of all valid syntax in R, but just a readable description of valid R expressions.

It is possible to write almost any R expression as a function call. However, it’s confusing reading lots of embedded function calls, so R provides some special syntax to make code for common operations more readable.[16]

[16] You could write R code as a series of function calls with lots of function calls. This would look a lot like LISP code, with all the parentheses. Incidentally, the S language was inspired by LISP and uses many of the same data structures and evaluation techniques that are used by LISP interpreters.

Get R in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.