Hello,

2 is a double, 2L is an integer. Try

> class(2)
[1] "numeric"
> class(2L)
[1] "integer"


Hope this helps,

Rui Barradas

Em 15-05-2014 11:54, Alexander Engelhardt escreveu:
Hello R-help,

I keep noticing R functions that don't compare integers like
   if(x == 2)
but instead
   if(x == 2L)

Is this a long integer? Also, when do the two notations have a different
effect on the code?

Thanks in advance,
  Alex

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to