Try this:
x <- ftable(a.df$DATE, paste(a.df$GENDER, a.df$Co, sep = "-"))
as.data.frame(`class<-`(`dimnames<-`(x, list(attr(x, 'row.vars')[[1]],
attr(x, 'col.vars')[[1]])), 'matrix'))
On Tue, Jun 22, 2010 at 6:50 PM, Erin Hodgess wrote:
> Dear R People:
>
> I have the following data set with the
Erin -
Perhaps this reproducible example will help:
df = data.frame(a=sample(1:20,1,replace=TRUE),
b=sample(c('M','F'),1,replace=TRUE),
c=sample(LETTERS[1:8],1,replace=TRUE))
tt = as.data.frame(table(df))
tt$bc = paste(tt$b,tt$c,sep='.')
tt$b=NULL
tt
Dear R People:
I have the following data set with the columns DATE, GENDER, and Co.
Co has 8 possible options.
> a.df[1:10,]
DATE GENDER Co
1 2009-04-16 F Rash
2 2009-04-16 F Other
3 2009-04-16 M Botulinic
4 2009-04-16 M
3 matches
Mail list logo