【发布时间】:2017-05-24 15:22:32
【问题描述】:
我正在尝试调整 R 将数据框打印到控制台的方式。具体来说,我想打印一个数据框,使得列的文本在达到一定宽度后换行。理想情况下,我想要如下所示的内容:
v1 v2 v3
1 TRUE Some text TRUE
2 TRUE Some more text FALSE
3 TRUE This text wraps FALSE
after a certain
width
4 FALSE Even more text FALSE
5 TRUE More text TRUE
这是一个 MWE:
data.frame(v1 = c(TRUE, TRUE, TRUE, FALSE, TRUE), v2 = c("Some text", "Some more text", "This text wraps after a certain width", "Even more text", "More text"), y = c(TRUE, FALSE, FALSE, FALSE, TRUE))
options(width=10)
这是我所在的位置:
【问题讨论】:
标签: r printing console word-wrap pander