避免打印到控制台的字符串被截断(在RStudio中) [英] avoid string printed to console getting truncated (in RStudio)

查看:508
本文介绍了避免打印到控制台的字符串被截断(在RStudio中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在RStudio控制台上打印一个长字符串,以免被截断.

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)

,并浏览了print帮助页面上的参数.仍然没有运气.

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

要实现此目的,必须更改哪些参数/设置?

推荐答案

这是RStudio特有的功能,旨在帮助解决打印过长的字符串可能会导致IDE缓慢的问题. (我相信它是在最新版本v0.99.896中添加的)

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)

您可以通过将Limit length of lines displayed in the console to:选项设置为0来退出此截断(请参见对话框中的最后一个选项):

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):

这篇关于避免打印到控制台的字符串被截断(在RStudio中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆