如何增加R中最大打印的限制


86

我正在GraphR中使用该软件包对5461个项目进行maxclique分析。

我得到的最终输出项很长,因此我收到以下警告:

达到getOption("max.print")-省略475569行

有人可以给我指点一下如何增加限制max.print


4
您可能想要找到合适的输出格式并以这种方式导出。一旦您的数据足够大,快速打印到R控制台就变得不那么值得了。
Ari B. Friedman

Answers:


112

使用options命令,例如options(max.print=1000000)

?options

 ‘max.print’: integer, defaulting to ‘99999’.  ‘print’ or ‘show’
      methods can make use of this option, to limit the amount of
      information that is printed, to something in the order of
      (and typically slightly less than) ‘max.print’ _entries_.

你好艾克斯:看到结果输出:$ maxCliques [[179798]] [1]“ n4301”“ n4630”“ n4480”“ n4977”“ n4427” $ maxCliques [[179799]] [1]“ n4301”“ n4630”“ n4480“” n4592“ $ maxCliques [[179800]] [1]” n4301“” n4630“” n4480“” n4328“” n4595“ ...为什么从” $ maxCliques [[179798]]“开始而不是” $ maxCliques [[1]]”,真奇怪!
杰伊

1
@Jeol:R打印整个内容,但默认情况下,控制台仅存储最后8000行的输出。转到Edit-> GUI preferences...-> lines,然后增加该值。然后Save...OK
Richie Cotton

在我的情况下,此解决方案不起作用-运行后options(max.print=100)head(df, 30)我看到的是列名列表,而不是数据行。
罗伯特·F

41

?options

options(max.print=999999)

16
options(max.print = .Machine$integer.max)是最极端的版本
MichaelChirico

1

在程序顶部设置功能选项(最大打印= 10000)。因为您想在工作之前初始化它。它为我工作。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.