[R] is.integer() function

Gabor Csardi csardi at rmki.kfki.hu
Wed Jan 25 16:23:30 CET 2006


Becaues is.integer shows the internal representation, which is not an
integer but a double (real number). Some functions create integer vectors,
for example the : notation:

> is.integer(1:10)
[1] TRUE

You can create an integer vector with the integer() function:

> integer(10)
 [1] 0 0 0 0 0 0 0 0 0 0
> is.integer(integer(10))
[1] TRUE

Gabor

On Tue, Jan 24, 2006 at 09:29:51PM -0600, Taka Matzmoto wrote:
> Hi R users
> I have a simple question to ask.
> Why am I getting FALSE on this
> 
> >is.integer(10)
> [1] FALSE
> 
> 10 is a integer number.
> 
> Thanks in advance.
> 
> M
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
Csardi Gabor <csardi at rmki.kfki.hu>    MTA RMKI, ELTE TTK




More information about the R-help mailing list