Intro to Infix Operators in R
Infix refers to the placement of the arithmetic operator between variables. For example, an infix operation is given by (a+b), whereas prefix and postfix operators are given by (+ab) and (ab+), respectively.
The types of infix operators used in R include functions for data extraction, arithmetic, sequences, comparison, logical testing, variable assignments, and custom data functions.
The primary infix operators and their rank are listed below. The rank of an operator indicates the order in which a function is processed by R. This is relevant for dealing with complex expressions that involve two or more operators. Rank also confirms if brackets or parenthesis are useful or redundant. Examples in the table use the following data vectors as inputs:
> value1 <- c(7, 4, 4)
> value2 <- c(3, 5, 7)
List of Infix Operators in R
[table id=4 /]