[R] pooling categories in a table

Robin Hankin r.hankin at auckland.ac.nz
Tue Apr 9 01:34:12 CEST 2002


Peter Dalgaard writes:

> 
>  data(UCBAdmissions)
>  DF <- as.data.frame(UCBAdmissions)
>  DF$Dept <- factor(c(1,2,2,3,4,5)[DF$Dept],
>      labels=c("A","B+C","D","E","F"))
>  xtabs(Freq~.,DF)
> 


This is simply brilliant.  I found it very very instructive; any
chance of adding it to the examples section of xtabs()' help file?




-- 

Robin Hankin, Lecturer,
School of Geographical and Environmental Science
Private Bag 92019 Auckland
New Zealand

r.hankin at auckland.ac.nz
tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042

as of: Tue Apr  9 11:29:00 NZST 2002
This (linux) system up continuously for:  222 days, 18 hours, 24 minutes
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list