R Operators are mainly categorised in to:

- Arithmetic Operators
- Assignment Operators
- Logical Operators
- Relational Operators

__Arithmetic Operators__

These operators are used for mathematical operations.

- Addition [+]
- Subtraction [-]
- Multiplication [*]
- Division [/]
- Exponential [^]
- Modulus [%%]
- Integer Division [%/%]

__Examples:__

>a <- 6 >b <- 8 |
>a +b [1] 14 |
>a – b [1] -2 |
---|---|---|

>a * b [1]48 |
>b/a [1]1.33 |
>b%%a [1]1 |

__Assignment Operators__

- Less than minus [< -]
- Equal to [=]
- Double less than minus [<<-]
- Minus greater than [- >]
- Minus double greater than [->>]

__Examples:__

>a <- 2 | >a [1]2 |
---|---|

>a = 4 | >a [1]4 |

>6 ->a | >a [1]6 |

“<<- “and “->>” Operators are for assigning at a global level in the code.

__Logical Operators__

- Logical AND Operator [&&]
- Logical OR Operator [||]
- Logical NOT Operator [!]
- Element-wise Logical OR [|]
- Element-wise Logical AND [&]

__Examples:__

>a <- 2 | >a [1]2 |
>m|n [1] TRUE TRUE TRUE TRUE |
---|---|---|

> m <- c (FALSE, TRUE,2,7) > n – c(TRUE, FALSE,TRUE,FALSE) |
! m [1] TRUE FALSE FALSE FALSE |
> m||n [1] TRUE |

>a <- 2 | >a [1]2 |
>m&&n [1] FALSE |

m<- c (FALSE, TRUE,2,4) | >! m [1] TRUE FALSE FALSE FALSE |
>m &&n [1] FALSE FALSE TRUE FALSE |

__Relational Operators__

- Less than [<]
- Greater than [>]
- Less than equal to [<=]
- Greater than equal to [>=]
- Double Equal to [==]
- Not equal to [! =]

__Examples:__

>a <-3 > b <- 7 |
> a < b [1] TRUE |
> a > b [1] FALSE |
> a <= 5 [1] TRUE |
> a <= 4 [1] TRUE |
> a <= 5 [1] FALSE |
> a == b [1] FALSE |
> a != b [1] TRUE |
---|