[R] Fast way to finding index in Vector
Gundala Viswanath
gundalav at gmail.com
Tue Jan 13 03:22:13 CET 2009
Hi Jorge and all,
How can I modified your code when
query size can be bigger than repository,
meaning that it can contain repeats.
e.g. qr <- c("AAC", "ATT", "ATT","AAC", "ATT", "ATT", "AAT", "ATT", "ATT", )
Sorry, I should have mentioned this earlier.
- Gundala Viswanath
Jakarta - Indonesia
On Tue, Jan 13, 2009 at 11:11 AM, Jorge Ivan Velez
<jorgeivanvelez at gmail.com> wrote:
>
> Perhaps
> which(repo%in%qr)
> ?
> HTH,
>
> Jorge
>
>
> On Mon, Jan 12, 2009 at 9:07 PM, Gundala Viswanath <gundalav at gmail.com>
> wrote:
>>
>> Dear all,
>>
>> Suppose I have the following vector as repository:
>>
>> > repo <- c("AAA", "AAT", "AAC", "AAG", "ATA","ATT")
>>
>> Given another query vector
>>
>> > qr <- c("AAC", "ATT")
>>
>> is there a way I can find the query index in repository in a fast way.
>>
>> Giving:
>>
>> [1] 3 6
>>
>> Typically the size of repo is around ~12million element, and
>> query around ~1 million element.
>>
>>
>> - Gundala Viswanath
>> Jakarta - Indonesia
>>
>> ______________________________________________
>> 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.
>
>
More information about the R-help
mailing list