

   sink {base}                                  R Documentation

   SSeenndd RR OOuuttppuutt ttoo aa FFiillee

   DDeessccrriippttiioonn::

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

   UUssaaggee::

        sink(file = NULL, append = FALSE)

   AArrgguummeenntts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'; oth-
             erwise, it will overwrite the contents of `file'.

   DDeettaaiillss::

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

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

   EExxaammpplleess::

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

