Operators in R | R Programming

This is the fifth part of the R series. In this article will know about Operators in R Programming.The operators are those symbols which tell the compiler to perform mathematical manipulations.

There are mainly five types of operators, which are as follows:

1. Arithmetic Operators
2. Assignment Operators
3. Relational Operators
4. Logical Operators
5. Special Operators

Arithmetic Operators: These operators are used to perform arithmetic operations such as addition, subtraction, multiplication, division etc.
Syntax: Variable name <- value
Examples are:

# Addition
X <- 20
Y<- 10
X + Y

Output:

# Subtraction
X-Y

Output:

# Multiplication
X*Y

Output:

# Division
X/Y

Output:

Assignment Operators: These operators are used to assign values.
Examples are:

# Leftwards Assignment
X<-50
X

Output:

# Rightwards Assignment
10 -> X

Output:

3. Relational Operator: These Operators defines a relation between two entities.

X<-5
X!=3

Output:

4.Logical Operator: These Operators compare two entities and typically used with Boolean (logical) values.

X <-9
9&6

Output:

5. Special Operators: These operators are used for specific purpose.

X <-5:10

Output:


Loops in R | R Programming
Data Types in R |R Programming

5 thoughts on “Operators in R | R Programming”

  1. Having read this I believed it was very enlightening.

    I appreciate you spending some time and energy to put this content together.
    I once again find myself personally spending a lot
    of time both reading and commenting. But so what, it was still worth it!

  2. Good day! This is my first comment here so I just wanted to give a quick shout out and tell you I genuinely enjoy reading your blog posts.
    Can you suggest any other blogs/websites/forums that go over the same subjects?
    Thanks a ton!

Leave a Comment