Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有data.frame一个列有多行文本。如何包装文本以使用 grid.draw 打印数据框?我尝试使用 strwrap 但没有运气。
data.frame
A=data.frame(name=c("ABC","XYZ","DEF"),description=c(rep("This is an example for text wrap using grid.draw in package gridExtra",3))
使用gridExtra具有 function 的包grid.table,并将其添加\n到您想要中断的数据框中:
gridExtra
grid.table
\n
A=data.frame(name=c("ABC","XYZ","DEF"),description=c(rep("This is an example for text wrap \nusing grid.draw in package gridExtra",3)) grid.newpage() grid.table(A)
您可以使用各种参数很好地调整表格。