Tuesday, January 28, 2014

R session History and Image management

There are many powerful IDEs for R but if you are a command line user managing command history of your sessions or reusing objects you are working with, may not be that easy. Here are two simple commands which can help us with the same.

>  savehistory(file_name)



> loadhistory(file_name)


As you can see in screenshot above we wont get access to objects from previous sessions but we can browse all commands (like dim in screenshot) from the saved command history file (here histFile). We just need to press the 'up arrow key'.

Note: It makes more sense to add timestamp and small text while saving the file.

Now lets see how can we save object from existing session in order to access them again.

>  save.image('Image_name')


>   load('Image_name')


As you can see in the screenshot above we can access the objects from saved session.

No comments:

Post a Comment