Posts Tagged ‘ assignment-operators ’

Assignment operators in R: ‘=’ vs. ‘<-’

November 16, 2010
By
Assignment operators in R: ‘=’ vs. ‘<-’

In R, you can use  both ‘=’ and ‘<-’ as assignment operators. So what’s the difference between them and which one should you use? What’s the difference? The main difference between the two assignment operators is scope. It’s easiest to see the difference with an example: ##Delete x (if it exists) > rm(x) > mean(x=1:10)

Read more »