[R] Help with which()

Erik Iverson iverson at biostat.wisc.edu
Thu Jul 24 18:40:31 CEST 2008

Ben Bolker wrote:
> Erik Iverson <iverson <at> biostat.wisc.edu> writes:
>> See
> http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
>> naw3 <at> duke.edu wrote:
>>> I'm using which to find the position of a value in my data table
> [snip]
>> For example, when I do:
>>> where1<-which(Operons==3573.1,arr.ind=TRUE)
>>> it returns the position of that number and of 3573.15.
>   This doesn't seem like the same issue as the FAQ.
>   If there are really two elements in the array, one of
> which is 3573.1 and the other of which is 3573.15, they
> should not be treated as equal.  Something else is going on.
> Could the original poster please send a small reproducible
> example?

Yes, the more I look at it, the more I agree.  I just reacted when I saw
x == 3573.1 ...

It would be nice to see a reproducible example!

More information about the R-help mailing list