save                  package:base                  R Documentation

_S_a_v_e _R _O_b_j_e_c_t_s

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

     `save' writes a external representation of R objects to the
     specified file.  The objects can be read back from the file at a
     later date by using the function `load'.

     `save.image()' is just a short-cut for ``save my current
     environment'', i.e., `save(list = ls(all=TRUE), file = ".RData")'.
     It is what also happens with `q("yes")'.

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

     save(..., list = character(0), file = "", ascii = FALSE, oldstyle = FALSE)
     save.image(file = ".Rdata", oldstyle = FALSE)

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

     ...: the names of the objects to be saved.

    list: A character vector containing the names of objects to be
          saved.

    file: the name of the file where the data will be saved.

   ascii: if `TRUE', an ASCII representation of the data is written. 
          This is useful for transporting data between machines of
          different types.  The default value of `ascii' is `FALSE'
          which leads to a more compact binary file being written.

oldstyle: logical. Should the old (0.90.1 or earlier) format be used?
          Warning: this will be removed from R version 1.2.0 on.

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

     Almost all current R platforms (including Windows) use the XDR
     representation of binary objects in binary save-d files, and these
     are portable across all XDR-compliant implementations.

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

     `dput', `dump', `load'.

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

     x <- runif(20)
     y <- list(a = 1, b = TRUE, c = "oops")
     save(x, y, file = "xy.Rdata")
     save.image()
     unlink("xy.Rdata")
     unlink(".RData")

