\Header{sink}{Send R Output to a File}
\keyword{file}{sink}
\begin{Description}\relax
Diverts all \R{} output to \code{file}, overwriting the file unless
\code{append} is \code{TRUE}.\end{Description}
\begin{Usage}
\begin{verbatim}
sink(file = NULL, append = FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{file}] a character string naming the file to write to, or
\code{NULL} to stop ``sink''ing.
\item[\code{append}] if \code{TRUE}, output will be appended to
\code{file}; otherwise, it will overwrite the contents of
\code{file}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Only prompts and error messages continue to appear on the terminal.

\code{sink()} or \code{sink(file=NULL)} ends the diversion.\end{Details}
\begin{Examples}
\begin{ExampleCode}
sink("sink-examp.txt")
i <- 1:10
outer(i,i,"*")
sink()
unlink("sink-examp.txt")
\end{ExampleCode}
\end{Examples}

