简体   繁体   中英

R grid.table column heading character rotation

I am attempting to use grid.table to produce an image of a table for placement in a word document using Rstudio-knitr-pandoc. It is rather large with long column names. The solution I would like to accomplish is rotating the column headings to 90 vertical. Is this possible with grid.table or any other means?

I have tried

toxinsGrob<-tableGrob(cyano.xt,name='toxins',edits=gEdit(gPath='gpar.coltext',rot=90)) grid.draw(toxinsGrob)

to no avail. Suggetions?

Joel

it's easy with the new version of grid.table,

tt = ttheme_default(colhead=list(fg_params=list(rot=90)))
grid.newpage()
grid.table(head(iris), theme=tt)

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM