[Rd] indexing by character with identical names

Jake Michaelson jake.michaelson at gmail.com
Fri Sep 19 12:20:46 CEST 2008


On Fri, 2008-09-19 at 11:07 +0100, Barry Rowlingson wrote:

>  Some people may think it sensible that indexing a vector with an
> index of length N returns a vector of length N:
> 
>  > x[c("a","b","a")]
>  a b a
>  1 2 1

I also thought of this side of it after I sent the original email, and I
realized that this probably would break a lot of stuff.

I think at the very least the documentation for '[' could be updated to
emphasize that only first matches are returned when indexing with a
character vector.

Thanks,

Jake



More information about the R-devel mailing list