Hi, I'm using which to find the position of a value in my data table, and it is returning the correct position and the position of another number that differs by an extra decimal place. For example, when I do: where1<-which(Operons==3573.1,arr.ind=TRUE) it returns the position of that number and of 3573.15. Is it possible to get the function to only return a position if the number matches exactly? Thanks, -Nina
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:> Hi, > > I'm using which to find the position of a value in my data table, and it is > returning the correct position and the position of another number that differs > by an extra decimal place. For example, when I do: > > where1<-which(Operons==3573.1,arr.ind=TRUE) > > it returns the position of that number and of 3573.15. > > Is it possible to get the function to only return a position if the number > matches exactly? > > Thanks, > -Nina > > ______________________________________________ > R-help at 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.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 naw3 at duke.edu wrote: | Hi guys, | | Thank you all for looking at this, and I'm sorry - I was making a silly | mistake. | I was using a previous version of the data table in R, while looking at | a new | file in excel (its easier for me to view the data in excel since the | rows are | too long to fit on one line in R). ~ Have you tried View() ? ~ Ben -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIiL7ic5UpGjwzenMRAqX9AJ4/AwUbpYdNcn8IginJL3Jwnrf2UQCdF3Kp j7YprfOeRvs/U2svb9N/6Bs=btgW -----END PGP SIGNATURE-----