Relation operators is operators that are used to determine the relationship between two or more operands.
| Symbol | Description |
|---|---|
| “>” | Greater than |
| “<” | Less than |
| “>=” | Greater than or Equal |
| “<=” | Less than or Equal |
| “==” | Equal |
| “!=” | Not Equal |
Let’s see the examples below:
a = 9.5
x = 10
x > a
## [1] TRUE
a < x
## [1] TRUE
a >= x
## [1] FALSE
x <= a
## [1] FALSE
x == a
## [1] FALSE
a != x
## [1] TRUE
Relation operators only produce 2 values. TRUE and FALSE or 0 and 1.