avoid string printed to console getting truncated (in RStudio)

被刻印的时光 ゝ 提交于 2019-12-17 05:06:28

问题


I want to print a long string to the RStudio console so that it does not get truncated.

> paste(1:300, letters, collapse=" ")
[1] "1 a 2 b 3 c 4 d 5 e 6 f 7 g 8 h 9 i 
...
181 y 182 z 183 a 184 b... <truncated>

I supposed this should be fairly simple, but I cannot figure out how. I tried

options(max.print = 10000)

and looked through the args on the print help pages. Still no luck.

What parameter / settings to I have to change to achieve this?


回答1:


This is an RStudio-specific feature, intended to help resolve problems where printing overly long strings could cause IDE sluggishness. (I believe it was added with the latest release, v0.99.896)

You can opt-out of this truncation by setting the Limit length of lines displayed in the console to: option to 0 (see the final option in the dialog):



来源:https://stackoverflow.com/questions/36800475/avoid-string-printed-to-console-getting-truncated-in-rstudio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!