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)

