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)

(ALERT! Only applicable in R shells run from the console)

Topic revision: r2 - 21 Nov 2006 - 10:05:34 - TheresaScott
Main.ViewingWideWithScrolling moved from Main.HelpfulRCode5 on 21 Nov 2006 - 16:05 by TheresaScott - put it back
 
Register | Log In
Copyright © 2009 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback