Skip to main content

2.1) Restoring An R Session


To restore an R session that you’ve saved, go to the directory where you saved it and click on the ".Rdata" icon. When the R GUI window has opened, go to "File > Open script…" and click on your script file. If it seems to have disappeared, don’t panic! Check if the script file is visible in Windows Explorer – in which case, you may have forgotten to add the extension ".R" to it. Edit the name to add it now, and it should then appear in the “File > Open script…” window. Otherwise, check whether you may have been running R in another directory (e.g. "C://Programs/R") when you created the script file, and see if it’s there – then cut and paste it to the directory where you’re running R.

To see what objects have been stored in the current workspace, use objects() or ls() (again with empty brackets). To delete an object, use rm() (i.e. "remove"), with the object name in the brackets.