Hi,
I'm subsetting a named vector using character indices.
My vector of indices (or keys) is 10x longer than the vector
I'm subsetting. All my keys are distinct and only 10% of them
are valid (i.e. match a name of the vector being subsetted).
It is surprisingly slow:
x1 <- 1:1000
names(x1) <- pa
On 07/15/2010 01:12 AM, Hervé Pagès wrote:
> Hi,
>
> I'm subsetting a named vector using character indices.
> My vector of indices (or keys) is 10x longer than the vector
> I'm subsetting. All my keys are distinct and only 10% of them
> are valid (i.e. match a name of the vector being subsetted).
On 07/15/2010 08:38 AM, Martin Morgan wrote:
> On 07/15/2010 01:12 AM, Hervé Pagès wrote:
>> Hi,
>>
>> I'm subsetting a named vector using character indices.
>> My vector of indices (or keys) is 10x longer than the vector
>> I'm subsetting. All my keys are distinct and only 10% of them
>> are valid