Operators

R uses the following operator tokens:

+ - */%% ^ arithmetic
>>= < <= == != relational
!&| logical
~ model formulae
<- -> assignment
$ list indexing (the ‘element name’ operator)
: create a sequence

Several of the operators have different meaning inside model formulae. Thus * indicates the main effects plus interaction, : indicates the interaction between two variables and means all interactions up to the indicated power (see p. 332).

Get The R Book 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.