🤡Operators
Operators are the constructs that can manipulate the value of operands. Operators are used to performing operations on variables and values.
R divides the operators into the following groups:
Arithmetic operators
Assignment operators
Comparison operators
Logical operators
Miscellaneous operators
Arithmetic Operators
Assignment Operators
Assignment operators are used to assigning values to variables:
Note: <<-
is a global assigner. You will learn more about this in the Global Variable chapter from W3 Schools.
It is also possible to turn the direction of the assignment operator.
x <- 3 is equal to 3 -> x
Comparison Operators
Comparison operators are used to comparing two values:
Logical Operators
Logical operators are used to combine conditional statements:
NOTE: To understand the difference between &
vs &&
and
|
vs ||c
lick on the following link: R Basics 9 - Difference between single and double AND OR statements - & vs && and | vs ||
Miscellaneous Operators
Miscellaneous operators are used to manipulating data:
Sources of the contents on this page:
Last updated