Last answered:

16 Feb 2023

Posted on:

14 Feb 2023


Resolved: assigning Operators <- vs =

can I use <- or  = to assign variables?

Are they the same? can I use them interchangeably without running into problems ? 

1 answers ( 1 marked as helpful)
Posted on:

16 Feb 2023


Hi Yahia, 

thanks for reaching out and for the great question! I personally always use <- to assign a value of a variable in R, and tend to keep it that way for consistency. Technically both commands are valid in R and you should be able to use them interchangeably. But for the sense of continuity and clean code, you should choose one option and stick with it throughout.


365 Eli

Submit an answer