How to Start R, Stop R and save workspace

How to Start R?

How to Start R

As the starting text says. use q() to quit R. Upon quitting it will ask if you want to save the workspace.

Save workspace image? [y/n/c]:

This will create a file called .RData in the directory from which you started R. The next time you start R from that directory it will automatically load the .RData file . you can do q(“yes”) to save the workspace while quitting. When you quit R, a function called .Last is called. This helps you clean up

.Last <- function() {
       cat("cleaning up and exiting \n")

R cleaning up and exiting

For more info type in help(q) on the command line.

Leave a Comment