# R Operators

In this post, you will learn about various operators in R programming such as Arithmetic, Logical, Comparison, Assignment and Miscellaneous Operators.

## Operators –

Operators are used to perform operations on variables and values.

In the example below, we use the + operator to add together two values

> 10 + 5
[1] 15
> 

## Types of Operators in R language –

There are various types of operators in R language –

1. Arithmetic Operators
2. Logical Operators
3. Comparison Operator
4. Assignment Operators
5. Miscellaneous Operators

## 1 . Arithmetic Operators –

Arithmetic operators are used with numeric values to perform common mathematical operations.

## 2 . Logical Operators –

The logical operators allow a program to make a decision on the basis of multiple conditions. In the program, each operand is considered as a condition which can be evaluated to a false or true value. The value of the conditions is used to determine the overall value of the op1 operator op2.

The logical operator compares each element of the first vector with the corresponding element of the second vector.

## 3. Comparison Operators –

Comparison operators are used to compare two values.

## 4. Assignment Operators –

An assignment operator is used to assign a new value to a variable. In R, these operators are used to assign values to vectors. There are the following types of assignment.

## 5. Miscellaneous Operator –

Miscellaneous operators are used to manipulate data.

Rating: 1 out of 5.

Posted in RTagged