Re: [Rd] split(factor, shortGroupVector) gives incorrect results in R 2.12.2

2011-03-21 Thread peter dalgaard
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

[Rd] split(factor, shortGroupVector) gives incorrect results in R 2.12.2

2011-03-21 Thread William Dunlap
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 $