load                  package:base                  R Documentation

_R_e_l_o_a_d _S_a_v_e_d _D_a_t_a_s_e_t_s

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

     Reload datasets written with the function 'save'.

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

     load(file, envir = parent.frame())

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

    file: a connection or a character string giving the name of the
          file to load.

   envir: the environment where the data should be loaded.

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

     'load' can load R objects saved in the current or any earlier
     format.  It can read a compressed file (see 'save') directly from
     a file or from a suitable connection (including a call to 'url').

     Only R objects saved in the current format (used since R 1.4.0)
     can be read from a connection.  If no input is available on a
     connection a warning will be given, but any input not in the
     current format will result in a error.

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

     A character vector of the names of objects created, invisibly.

_W_a_r_n_i_n_g:

     Saved R objects are binary files, even those saved with 'ascii =
     TRUE', so ensure that they are transferred without conversion of
     end of line markers.  'load' tries to detect this case and give an
     informative error message.

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

     'save', 'download.file'.

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

     ## save all data
     save(list = ls(all=TRUE), file= "all.Rdata")

     ## restore the saved values to the current environment
     load("all.Rdata")

     ## restore the saved values to the user's workspace
     load("all.Rdata", .GlobalEnv)

     ## Not run: 
     ## print the value to see what objects were created.
     print(load(url("http://some.where.net/R/data/kprats.rda")))
     ## End(Not run)

