sink                  package:base                  R Documentation

_S_e_n_d _R _O_u_t_p_u_t _t_o _a _F_i_l_e

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

     Diverts all R output to `file', overwriting the file unless
     `append' is `TRUE'.

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

     sink(file = NULL, append = FALSE)

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

    file: a character string naming the file to write to, or `NULL' to
          stop ``sink''ing.

  append: if `TRUE', output will be appended to `file'; otherwise, it
          will overwrite the contents of `file'.

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

     Only prompts and error messages continue to appear on the
     terminal.

     `sink()' or `sink(file=NULL)' ends the diversion.

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

     sink("sink-examp.txt")
     i <- 1:10
     outer(i,i,"*")
     sink()
     unlink("sink-examp.txt")

