save.session             package:session             R Documentation

_S_a_v_e _a_n_d _r_e_s_t_o_r_e _s_e_s_s_i_o_n _i_n_f_o_r_m_a_t_i_o_n, _i_n_c_l_u_d_i_n_g _l_o_a_d_e_d _p_a_c_k_a_g_e_s
_a_n_d _a_t_t_a_c_h_e_d _d_a_t_a _o_b_j_e_c_t_s.

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

    file: Filename for the session information. 

     ...: Optional arguments for 'save()' or 'load()'. 

_D_e_t_a_i_l_s:

     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, 'sinks's, pipes, etc. will not be stored.
     'save.session' issues a  warning to this effect if any graphics
     devices are open.

_V_a_l_u_e:

     No return value.

_N_o_t_e:

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

_A_u_t_h_o_r(_s):

     Gregory R. Warnes warnes@bst.rochester.edu

_S_e_e _A_l_s_o:

     'save', 'save.image', 'load'

_E_x_a_m_p_l_e_s:

       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

