session: Save and restore session information, including loaded...

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

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

Usage

1
2
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 greg@warnes.net

See Also

save, save.image, load

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
  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

session documentation built on May 1, 2019, 10:11 p.m.

Related to session in session...