G'day Melanie,

On Wed, 23 Apr 2008 17:46:56 -1000
Melanie Abecassis <[EMAIL PROTECTED]> wrote:

> This doesn't seem to happen with integers.
> Am I missing something ?? 

Yes, FAQ 7.31:

http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f

> Is there a better function for non-integers ?

> which(sapply(tt, function(x) isTRUE(all.equal(x,1.7))))
[1] 8

seems to work.

HTH.

Cheers,

        Berwin

=========================== Full address =============================
Berwin A Turlach                            Tel.: +65 6515 4416 (secr)
Dept of Statistics and Applied Probability        +65 6515 6650 (self)
Faculty of Science                          FAX : +65 6872 3919       
National University of Singapore
6 Science Drive 2, Blk S16, Level 7          e-mail: [EMAIL PROTECTED]
Singapore 117546                    http://www.stat.nus.edu.sg/~statba

______________________________________________
R-help@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.

Reply via email to