sometimes I absentmindedly want to print out an object that I just created (like a huge matrix). unfortunately this causes Rstudio to stall, as printing all that data to the console is a near impossible task. I sometimes can ctrl-c to stop the print, but only if I do it quickly enough. Is there a setting in Rstudio that will cause a print to fail if its taking too long?
We’ve all done that.
This won’t help with matrices, but if you are dealing with dataframes, then tibbles (or data.tables) only print a limited no. of rows precisely for this reason.
My real enemy is JSON. I try to stick with str() and occasionally use max levels where needed. That or head. Never print