From p.dalgaard@biostat.ku.dk  Tue Jan  6 17:09:57 1998
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 06 Jan 1998 18:09:57 +0100
Subject: More on tapply and factors
In-Reply-To: Douglas Bates's message of Tue, 6 Jan 1998 09:59:46 -0600 (CST)
References: <m0xpbPu-000hhBC@franz.stat.wisc.edu>
Message-ID: <x2vhvxil5m.fsf@blueberry.kubism.ku.dk>

Douglas Bates <bates@stat.wisc.edu> writes:

> > tapply( Machines$Machine, Machines$Worker, table )
> $6
> integer(0)

Yuk! Apparently, the culprit is "split":

> f1<-gl(2,1,4)
> f2<-gl(2,2,4)
> dput(split(f1,f2))
list(1 = factor(c(1, 2), levels=1:0), 2 = factor(c(1, 2), levels=1:0))

> dput(f1)
structure(factor(c(1, 2, 1, 2), levels=1:2), class = "factor", .Label = c("1", 
"2"))
> dput(f2)
structure(factor(c(1, 1, 2, 2), levels=1:2), class = "factor", .Label = c("1", 
"2"))

I wonder if this is a side effect of the ...hmm... "undesirable
feature" of as.numeric(factor)??

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


More on tapply and factors
Peter Dalgaard BSA