Wide-view using Less in R
Ever have a matrix or data frame with lots of columns and wanted to view it all together instead of chopped up? Here's how:
oldPager <- getOption("pager")
options(width=10000)
options(pager="less -S")
wideMatrix <- matrix(sample(1:100, 10000, replace=TRUE), ncol=100)
page(wideMatrix, method="print")
This will allow you to scroll horizontally with the arrow keys. To go back to the default behavior, run:
options(width=80)
options(pager=oldPager)
(
Only applicable in R shells run from the console)