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

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

