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 the datasets written to a file with the function 'save'.

_U_s_a_g_e:

     load(file, envir = parent.frame())
     loadURL(url, envir = parent.frame(), quiet = TRUE, ...)

_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.

     url: a character string naming a URL.

quiet, ...: additional arguments to 'download.file'.

_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').

     'loadURL' is a convenience wrapper which downloads a file, loads
     it and deletes the downloaded copy.

_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.

_S_e_e _A_l_s_o:

     'save', 'download.file'.

_E_x_a_m_p_l_e_s:

     ## save all data
     save(list = ls(), 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: 
     ## This example is not real
     ## print the value to see what objects were created.
     print(loadURL("http://some.where.net/R/data/kprats.rda"))
     # or, avoiding making a local copy,
     print(load(url("http://some.where.net/R/data/kprats.rda")))
     ## End(Not run)

