Pregunta

My R code runs a statistical analysis, which takes a long time (many iterations and loops). It saves results to files, but while it is running, it also displays some results in the console of Rstudio, such as convergence warnings. Since this analysis takes a long time, I don't sit behind Rstudio all day to check output on the console. But once it's done running, I'd like to review the convergence warnings. I've found now that I cannot scroll all the way up in the console to see all output there - there seems to be a limit. And it seems to be different for Rstudio I am running on a server and the one I am running on my own laptop (Rstudio on the server allows me to go further back into the console history).

Is this just a limitation of Rstudio, or is there a way to go further back into the console? I haven't been able to figure it out...

¿Fue útil?

Solución

There is indeed a limit, and it isn't adjustable for performance reasons (too many lines can really slow down the interface!).

If you need to be able to review the results of a long-running analysis, your best bet is to divert its output to a file instead of letting it go to the R console. Do this by using the R sink command.

Documentation for sink.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top