On Mar 21, 2011, at 17:16 , William Dunlap wrote:
>> split(factor(letters[1:3]), c("Group one", "Group two"))
Yes, that's a bug (at the very least, it is against documented behavior)
The strong suspicion is that
ind <- .Internal(split(seq_along(f), f))
should have seq_along(x) , not f. B
When split's x argument has a class attribute and the
grouping vector, f, is shorter than x then split gives
the wrong result. It appears to not extend f to the length
of x before doing the split. E.g.,
> split(factor(letters[1:3]), "Group one") # expect all 3 elements in
the single group
$