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
rea
2008/9/19 Jake Michaelson <[EMAIL PROTECTED]>
> ... that is, if a vector has identical (and therefore ambiguous) names,
> it only returns the first match when the vector is indexed by a
> non-unique name. From my perspective, a more sensible behavior would be
> to return *all* elements which carr
Hi all,
I've been using R for a while, but was puzzled when I just barely
noticed this behavior:
> x <- 1:10
> names(x) <- c("a","b","a",letters[1:7])
> x
a b a a b c d e f g
1 2 3 4 5 6 7 8 9 10
> x["a"]
a
1
... that is, if a vector has identical (and therefore ambiguous