Skip to content
Prev 174584 / 398506 Next

How to get commands history as a character vector instead of displaying them?

Yihui Xie wrote:
history eventually calls file.show, which will use the pager option to 
determine how to show the file, so you can do something like that:

history <- function( ... ){
old.op <- options( pager = function( files, header, title, delete.file ) 
readLines( files ) ); on.exit( options( old.op ) )
utils::history(...)
}
history( pattern = "png" )

I don't see a way to get device information other than the name of the 
device (with dev.cur)

Romain