When you close the RGui or the R console window, the system will ask if you want to save the workspace image. If you select to save the workspace image then all the objects in your current R session are saved in a file
RData. This is a binary file located in the working directory of R, which is by default the installation directory of R.
During your R session, you can also explicitly save the workspace image.
Go to the
\File/ Save Workspace... , or use the