save.session {session}R Documentation

Save and restore session information, including loaded packages and attached data objects.

Description

Save and restore session information, including loaded packages and attached data objects.

Usage

save.session(file=".RSession", ...)
restore.session(file=".RSession", ...)

Arguments

file Filename for the session information.
... Optional arguments for save() or load().

Details

These two functions save and restore R session information. In addition to the objects in the session, the list of currently loaded packages and the search path are (re)stored.

Open graphics devices, sinkss, pipes, etc. will not be stored. save.session issues a warning to this effect if any graphics devices are open.

Value

No return value.

Note

Future enhancements may allow the restoration of the size, location, and graphics settings of graphics devices.

Author(s)

Gregory R. Warnes warnes@bst.rochester.edu

See Also

save, save.image, load

Examples


  ls(all=TRUE) # show all data objects
  search()  # list search path

  # save the current R session to the file "RSession.Rda"
  save.session("RSession.Rda")

  ## Not run: 
  # exit R without saving data
  q("no")

  # restart R
  R 
  ## End(Not run)

  # load a saved R session from "RSession.Rda"
  restore.session("RSession.Rda")

  ls(all=TRUE) # show all data objects
  search()  # list search path


[Package session version 1.0.2 Index]