Equivalent to unix "less" command within R console Equivalent to unix "less" command within R console shell shell

Equivalent to unix "less" command within R console


There is also page() which displays a representation of an object in a pager, like less.

dat <- data.frame(matrix(rnorm(1000), ncol = 10))page(dat, method = "print")


Not really. There are the commands

  • head() and tail() for showing the beginning and end of objects
  • print() for explicitly showing an object, and just its name followed by return does the same
  • summary() for concise summary that depends on the object
  • str() for its structure

and more. An equivalent for less would be a little orthogonal to the language and system. Where the Unix shell offers you less to view the content of a file (which is presumed to be ascii-encoded), it cannot know about all types.

R is different in that it knows about the object types which is why summary() -- as well as the whole modeling framework -- are more appropriate.

Follow-up edit: Another possibility is provided by edit() as well as edit.data.frame().


I save the print output to a file and then read it using an editor or less.

Type the following in R

sink("Routput.txt")print(varname)sink()

Then in a shell:

less Routput.txt