From pdalgd at gmail.com  Mon Mar 21 18:13:29 2011
From: pdalgd at gmail.com (peter dalgaard)
Date: Mon, 21 Mar 2011 18:13:29 +0100
Subject: [Rd] split(factor,
	shortGroupVector) gives incorrect results in R 2.12.2
In-Reply-To: <77EB52C6DD32BA4D87471DCD70C8D70004086330@NA-PA-VBE03.na.tibco.com>
References: <77EB52C6DD32BA4D87471DCD70C8D70004086330@NA-PA-VBE03.na.tibco.com>
Message-ID: <AAE93A2B-6866-40E8-81CF-CF4ACF0EA1AA@gmail.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



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