[Rd] 'is.integer' (PR#13671)
Mathieu Ribatet
mathieu.ribatet at epfl.ch
Wed Apr 22 22:03:05 CEST 2009
To the best of my knowledge this is not a bug. According to FAQ 3.3.3
"Numeric constants with no fractional and exponent (i.e., only integer)
part are taken as integer in S-Plus 6.x or later, but as double in R."
You can see it by invoking
>storage.mode(1)
[1] "double"
Hence, if you really want to have integers, you need to use as.integer
i.e.
> storage.mode(as.integer(1))
[1] "integer"
Cheers,
Mathieu
Le mercredi 22 avril 2009 à 19:45 +0200, hzambran.newsgroups at gmail.com a
écrit :
> Full_Name: Mauricio
> Version: 2.9.0 (2009-04-17)
> OS: i486-pc-linux-gnu
> Submission from: (NULL) (193.205.203.3)
>
>
> This is a very simple function that seems not to be working, according to the
> definition given by '?is.integer'.
>
> I checked in the Bug Tracking page at http://bugs.R-project.org/, but I didn't
> find any related message.
>
> The possible problem is:
>
>
> > is.integer(1)
> [1] FALSE
>
> and 1 is obviously an integer value.
>
>
> I would really appreciate if you could clarify if this is really a bug or not.
>
> Thanks in advance,
>
> Mauricio
>
> > version
> _
> platform i486-pc-linux-gnu
> arch i486
> os linux-gnu
> system i486, linux-gnu
> status
> major 2
> minor 9.0
> year 2009
> month 04
> day 17
> svn rev 48333
> language R
> version.string R version 2.9.0 (2009-04-17)
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
--
Institute of Mathematics
Ecole Polytechnique Fédérale de Lausanne
STAT-IMA-FSB-EPFL, Station 8
CH-1015 Lausanne Switzerland
http://stat.epfl.ch/
Tel: + 41 (0)21 693 7907
More information about the R-devel
mailing list