[R] Returning Non-Unique Index with Which (alternatives?)

Gundala Viswanath gundalav at gmail.com
Tue Jan 13 03:41:01 CET 2009


Dear all,


I tried to find index in repo given  a query with this:

> repo <- c("AAA", "AAT", "AAC", "AAG", "ATA", "ATT")
> qr <- c("AAC", "ATT", "ATT")
> which(repo%in%qr)
[1] 3 6


Note that the query contain repeating elements, yet
the output of which only returns unique.

How can I make it returning

[1] 3 6 6

instead?


- Gundala Viswanath
Jakarta - Indonesia




More information about the R-help mailing list