R: Assignment Operators

Profile picture for user devanshi.srivastava
Submitted by devanshi.srivastava on

Assignment Operators are used for assigning values to various data objects. The objects may be of any type like integer, vectors or functions. 

1. Leftwards Assignment (<-, <<-, =)

It is used to assign values to a vector.

2. Rightwards assignment (->, ->>)

It is used to assign values to a vector.

Examples:

> x<-20
> x
> 30->y
> y
> x=7
> x

Output:

[1] 5

[1] 30

[1] 7