[R] Difference between 10 and 10L

William Dunlap wdunlap at tibco.com
Fri May 4 01:43:33 CEST 2012


  > class(10)
  [1] "numeric"
  > class(10L)
  [1] "integer"
  > class(10i)
  [1] "complex"

Why not 10I for integer?  Perhaps because "I" and "l"
look too similar, perhaps because "i" and "I" sound
too similar.  The "L" does not mean "long": integers
are 4 bytes long.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf
> Of brwin338
> Sent: Thursday, May 03, 2012 4:33 PM
> To: r-help at r-project.org
> Subject: [R] Difference between 10 and 10L
> 
> 
> Good Evening
> We have been searching through the R documentation manuals without success on this
> one.
> What is the purpose or result of the "L" in the following?
> 
> n=10
> and
> n=10L
> 
> or
> c(5,10)
> versus
> c(5L,10L)
> 
> Thanks
> Joe
> 
> 
> 
> Thanks
> Joe
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list