Skip to main content
3 of 8
added assignment-operator tag
Mark Byers
  • 843.6k
  • 202
  • 1.6k
  • 1.5k

Assignment operators in R: '=' and '<-'

What are differences in the assignment operators '=' and '<-' in R? I know that operators are slightly different as this example shows

> x <- y <- 5 > x = y = 5 > x = y <- 5 > x <- y = 5 Error in (x <- y) = 5 : could not find function "<-<-" 

But is this the only difference?

csgillespie
  • 60.8k
  • 15
  • 160
  • 188