[R] Difference between 10 and 10L

Petr Savicky savicky at cs.cas.cz
Fri May 4 09:04:50 CEST 2012


On Thu, May 03, 2012 at 07:32:46PM -0400, brwin338 wrote:
> 
> 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)

Hi.

The help page ?"1L" or, equivalently, ?NumericConstants says

     An numeric constant immediately followed by ‘L’ is regarded as an
     ‘integer’ number when possible (and with a warning if it contains
     a ‘"."’).

Try typeof(1) and typeof(1L).

Petr Savicky.



More information about the R-help mailing list