Skip to content
Back to formatted view

Raw Message

Message-ID: <AAE93A2B-6866-40E8-81CF-CF4ACF0EA1AA@gmail.com>
Date: 2011-03-21T17:13:29Z
From: Peter Dalgaard
Subject: split(factor, shortGroupVector) gives incorrect results in R 2.12.2
In-Reply-To: <77EB52C6DD32BA4D87471DCD70C8D70004086330@NA-PA-VBE03.na.tibco.com>

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: pd.mes at cbs.dk  Priv: PDalgd at gmail.com