[R] = vs. ==?
gabraham at csse.unimelb.edu.au
Wed Apr 16 00:58:22 CEST 2008
> Could anyone please explain to me the difference between the = and the ==?
> I'm quite new to R and I've tried to find out but didn't get any wiser...
"=" is the assignment operator as in
> x = 3
(but use the "<-" operator instead, see a post by Bill Venables a few
days ago called ``What to use for assignment, " = " or " <- "?'')
whereas "==" is the binary operator for testing equality, as in
> x == 3
Have a look at any introductory R book or at the R intro at
Dept. CSSE and NICTA
The University of Melbourne
Parkville 3010, Victoria, Australia
email: gabraham at csse.unimelb.edu.au
More information about the R-help