print to pdf file using grid.table in r - too many rows to fit on one page

后端 未结 6 1728
没有蜡笔的小新
没有蜡笔的小新 2020-12-06 11:53

I\'m trying to output a dataframe of about 40 rows and 5 columns to a .pdf file using grid.table in gridExtra package of R.

However, 40 rows is too long for a page

6条回答
  •  醉梦人生
    2020-12-06 12:20

    One way is to shrink the font the font size and the horizontal/vertical padding.

    grid.table(mtcars, gpar.coretext = gpar(fontsize=6), gpar.coltext = gpar(fontsize=6), padding.h=unit(2, "mm"), padding.v=unit(2, "mm"), show.rownames = TRUE)

提交回复
热议问题