First of all a disclaimer: I am a Stata user trying to fully make the "jump" to R (slowly, though).
I was making some easy crosstabs when I saw that one of them simply does not fit my console size. In Stata, using the same data and the same variables, the crosstab fits perfectly fine. However, in R everything becomes very messy.
The table is 10x10. A reproducible example below:
library(gmodels)
df <- data.frame(id = 1:100, x1=sample(1:7, size=100,replace=TRUE),
x2 = sample(0:10, size=100, replace=TRUE))
CrossTable(df$x1, df$x2, prop.r=TRUE, prop.t=TRUE, prop.c=TRUE)
The above table does not fit in my screen. I am not even interested in putting it in a LaTeX document yet; I just wanted to explore that crosstab. I am interested in using CrossTable as it produces what, to me, is a good-looking table with percentages (rows and columns) and totals in the margins. I do not know if this is a problem with CrossTable or if it is due to how my R installation displays/limits output. I tried doing the same in a Rmarkdown specifying with "options(widht=huge_number)" a bigger space, but this was to no avail.
Some other threads did not help me very much. I could not find anything directly related to my issue. Examples of threads:
How do I fit a very wide grid.table or tableGrob to fit on a pdf page?
Automatically adjust LaTeX table width to fit pdf using knitr and Rstudio
Any help will be greatly appreciated. I am also open to learning other packages that result in similar outputs. Thanks!