Hello! I'm not sure if is it a BUG or not... I'm using R 1.9.0, and I used the command below:> is.integer(9)[1] FALSE R manual contains this words about the is.integer() function: "is.integer returns TRUE or FALSE depending on whether its argument is of integer type or not." What's the problem? Am I wrong about the BUG report? Thank you very much. M?rcio de Medeiros Ribeiro Graduando em Ci?ncia da Computa??o Departamento de Tecnologia da Informa??o - TCI Universidade Federal de Alagoas - UFAL Macei? - Alagoas - Brasil Projeto CoCADa
On Wed, 16 Jun 2004 mmr@tci.ufal.br wrote:> I'm not sure if is it a BUG or not...You were wrong to send a bug report if you are not sure: see the R FAQ.> I'm using R 1.9.0, and I used the command below: > > > is.integer(9) > [1] FALSE > > R manual contains this words about the is.integer() function: > > "is.integer returns TRUE or FALSE depending on whether its argument is of > integer type or not." > > What's the problem? Am I wrong about the BUG report?9 is a double constant, not an integer constant. The type of `9' is not integer: try it> typeof(9)[1] "double" -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Hi Marcio, it's not a bug, it's a well-documented feature. In the S language, numeric literals are floating point by default. > mode(9) [1] "numeric" > is.integer(9) [1] FALSE > is.integer(as.integer(9)) [1] TRUE Best wishes Wolfgang -- ------------------------------------- Wolfgang Huber Division of Molecular Genome Analysis German Cancer Research Center Heidelberg, Germany Phone: +49 6221 424709 Fax: +49 6221 42524709 Http: www.dkfz.de/abt0840/whuber ------------------------------------- mmr@tci.ufal.br wrote:> Hello! > > I'm not sure if is it a BUG or not... > I'm using R 1.9.0, and I used the command below: > > >>is.integer(9) > > [1] FALSE > > R manual contains this words about the is.integer() function: > > "is.integer returns TRUE or FALSE depending on whether its argument is of > integer type or not." > > What's the problem? Am I wrong about the BUG report? > > Thank you very much. > > M?rcio de Medeiros Ribeiro > Graduando em Ci?ncia da Computa??o > Departamento de Tecnologia da Informa??o - TCI > Universidade Federal de Alagoas - UFAL > Macei? - Alagoas - Brasil > Projeto CoCADa