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

From: peter dalgaard <>
Date: Mon, 21 Mar 2011 18:13:29 +0100

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. But would that break for other reasons?

(It would! Surv() objects to name one case. In general, we seem to be in trouble if "[" and length() methods are not compatible.)

Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email:  Priv:

______________________________________________ mailing list
Received on Mon 21 Mar 2011 - 17:16:01 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 22 Mar 2011 - 01:20:35 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive