Ravi S. Shankar <ravis <at> ambaresearch.com> writes: > > I am using the CrossTable function from library(gmodels). > > x=unique(data[,c("L1","L1_Revenues","RIC")]) > > L1_Classification=CrossTable(x$L1,x$L1_Revenues,exclude = > c("NA","","0%","0"),prop.r=FALSE,prop.c=FALSE,prop.t=FALSE,prop.chisq=FA > LSE,dnn=c("L1_Classification","Revenue")) > > What I would like to do is to get the out put in excel. Also I do not > want the output displayed on the console. Is there some way of doing > this?
gmodels' CrossTable is not very flexible for this, because it has hard-wired cat producing the output. Try to massage ftable: ft = ftable(mtcars$cyl, mtcars$vs, mtcars$am, mtcars$gear) write.csv(ft, file = "ft.csv") # see docs how to Also check package Hmisc and reshape (the latter is not very flexible for categorical data, but good for numeric). Dieter ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.