Hi,
I'm having trouble with the "which" or the "seq" function, I'm not sure.
Here's an example :


 > lat=seq(1,2,by=0.1)
 > lat
 [1] 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0

 > which(lat==1)
[1] 1
 > which(lat==1.1)
[1] 2
 > which(lat==1.2)
[1] 3
 > which(lat==1.3)
[1] 4
 > which(lat==1.4)
[1] 5
 > which(lat==1.5)
[1] 6
 > which(lat==1.6)
[1] 7
 > which(lat==1.7)
*integer(0)*
 > which(lat==1.8)
[1] 9
 > which(lat==1.9)
[1] 10
 > which(lat==2)
[1] 11

This doesn't seem to happen with integers.
Am I missing something ?? Is there a better function for non-integers ?

Thanks a lot,
Melanie

______________________________________________
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