How to export CrossTable output to Excel

I do not have the gmodels package but looking at the documentation, the output of CrossTable is a list with several components. Do you want to export one or more of the matrices?

t: An n by m matrix containing table cell counts
prop.col: An n by m matrix containing cell column proportions
prop.row: An n by m matrix containing cell row proportions
prop.tbl: An n by m matrix containing cell table proportions

An easy but clumsy way to do that it to write the matrix as a csv file with write.csv() and then import that into Excel. If you need to create an Excel file directly from R, that will be more difficult but can certainly be done.
For more detailed help, could you please post a Reproducible Example?

1 Like