Skip to content
Prev 360454 / 398503 Next

How to print the frequency table (produced by the command "table" to Excel

Hi jpm miao,
You can get CSV files that can be imported into Excel like this:

library(prettyR)
sink("excel_table1.csv")
delim.table(table(df[,c("y","z")]))
sink()
sink("excel_table2.csv")
delim.table(as.data.frame(table(df[,c("y","z")])),label="")
sink()
sink("excel_table3.csv")
delim.table(as.matrix(table(df[,c("y","z")])),label="")
sink()

Jim
On Wed, Apr 27, 2016 at 8:35 AM, jpm miao <miaojpm at gmail.com> wrote: