split(.) woes + "very cheap" fix

Thomas Lumley thomas@biostat.washington.edu
Tue, 6 Jan 1998 09:55:38 -0800 (PST)

On Tue, 6 Jan 1998, Martin Maechler wrote:

> A very silly workaround (which I am  NOT committing to the sources) 
> which seems to help is
>   split.default <- function(x,f) {
> 	  if(is.factor(x)) x <- codes(x)
> 	  .Internal(split(x,as.factor(f)))
>   }

It looks as though what we really need to do is to remove and then restore
some of the attributes of x.  The question is, which ones? Factor levels
do want to be restored, but other things like dimension don't.


r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch