On Fri, Mar 12, 2010 at 11:18, David Winsemius <dwinsem...@comcast.net> wrote: > > On Mar 12, 2010, at 11:15 AM, Ali Tofigh wrote: > >> I'm using R under Linux. Since the help function in R can use the >> program less to display text, I'd like to know if it is possible for a >> user to do the same. It would be very helpful to be able to view large >> objects (matrices/dataframes etc) using less. This is preferable to >> redirecting output to file or to clutter the workspace with too much >> output. I have tried to use functions pipe and sink, but I have had no >> luck getting it to work. Can this be done? > > ?capture.output
Thanks for the pointer. For all the lazy users out there, here is what worked for me: capture.output(big.matrix, file=pipe("less")) Or even better, define a function less <- function(x) {capture.output(x, file=pipe("less"))} Then you can just do: less(big.matrix) Cheers, /Ali ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.