R Relational Operators

Relational operators are used to comparing values. Here is a list of relational operators available in R.

Relational Operators in R

Operator

Description

\<

Less than

\>

Greater than

\<=

Less than or equal to

\>=

Greater than or equal to

==

Equal to

!=

Not equal to

Some examples are:

x = 5

y = 16

x\<y

[1] TRUE

x\>y

[1] FALSE

x\<=5

[1] TRUE

y\>=20

[1] FALSE

y == 16

[1] TRUE

x != 5

[1] FALSE

Last updated

Was this helpful?