More than 1000 lines output in R Studio console

Hi there,
I have adjusted the printed output with

options(max.print=100000)

and I got the whole data_frame() as output in the console, but then I can only scroll back 1000 lines in R Studio console. Is there an hint to disable this limitation?

Thanks, Michael

1 Like

Can you explain why you want all of that text in the window? It's unlikely you can process over 1000 lines of text in your mind, and even if that is your goal, it would be more straightforward to export the data to a more readable format.

Hi Nick,
you are 99% right, I agree! But sometimes it is the case that I want "to scroll" through the data (e.g. visual data check etc.). I know there are other ways to look at my data, but I do not fully understand why this 1000-line-limitation is implemented. By the way, because you mentioned "text", in my case it very often a data.frame() with let's say 10.000 lines, normally I used tibble/as_data_frame() and in 95% of the cases I am happy with the head-10-lines of the data.frame... but why isnt there a preference to put this "1000"-value higher?

But, Thanks for your answer.

See also here(1) and here(2)

The reason the console is limited to 1,000 lines is that, on most systems, RStudio's interface slows down considerably when the console grows too large. In a future version of RStudio, we hope to implement virtual scrolling for the console, so that it can grow without slowing down the interface.

In the meantime: have you tried View(as_data_frame(...))? That'll get you a nice scrollable interface to your data, and View() shows an unbounded number of rows.

6 Likes

Yes, thanks, I ve tried this,but the experience is an other than scrolling in the console. It would be nice to have the possibility to set an own value their (instead of 1000).

Is it in the mean time possible to set somewhere more than 1e3 lines within console output?

I have the same question. My script has output for 20+ user files and it is much more than 1e3 lines. Asking if something changed about it since. Thanks.

Hi Folks,

I've just registered with RStudio community. Stardate 16/10/2019.

Any advance on this issue of a max of 1000 visible rows in the console?

Thanks.

1 Like

Starting in RStudio 1.3.688, and with the latest rstudioapi from github, it is now possible to do what you want as follows:

rstudioapi::writeRStudioPreference("console_max_lines", 300)

where 300 is the number of lines you'd like your scrollback buffer to be. Keep in mind that large values can make the UI slow.

For those hoping to scroll back to capture the output of long scripts, I encourage you to look into sink() instead.

https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/sink

2 Likes