R: Relational Operators

The Relation Operators are used to carry out comparisons between two operands. The output is boolean (TRUE or FALSE). It returns True if the first operand satisfies the relation compared to the second. It also finds out the relation between the two operands provided to them. 

1. Equal (==)

It returns true if both the operand are equal to each other.

Usage: a==b

2. Less Than (<)

It returns true if the first operand is less than the second operand.

Usage: a<b

3. Greater Than (>)

It returns true if the first operand is greater than the second operand.

Usage: a>b

4. Less than equal to (<=)

It returns true if the first operand is less than or equal to the second operand.

Usage: a<=b

5. Greater than equal to (>=)

It returns true if the first operand greater than or equal to the second operand.

Usage: a>=b

6. Not equal to (!=)

It returns true if the first operand is not equal to the second operand.

Usage: a!=b

Examples:

> a<-3
> b<-5
> a==b
> a<b
> a>b
> a<=b
> a>=b
> a!=b

Output:

[1] FALSE

[1] TRUE

[1] FALSE

[1] TRUE

[1] FALSE

[1] TRUE