\Header{cat}{Concatenate and Print}
\keyword{print}{cat}
\keyword{file}{cat}
\keyword{connection}{cat}
\begin{Description}\relax
Prints the arguments, coercing them if necessary to character mode first.
\end{Description}
\begin{Usage}
\begin{verbatim}
cat(... , file = "", sep = " ", fill = FALSE, labels = NULL,
    append = FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{...}] \R{} objects which are coerced to character strings,
concatenated, and printed, with the remaining arguments
controlling the output.
\item[\code{file}] A connection, or a character string naming the file
to print to.  If
\code{""} (the default), \code{cat} prints to the standard output
connection, the console unless redirected by \code{\Link{sink}}.
If it is \code{"|cmd"}, the output is piped to the command given
by \file{cmd}, by opening a pipe connection.

\item[\code{sep}] character string to insert between the objects to print.
\item[\code{fill}] a logical or numeric controlling how the output is
broken into successive lines.  If \code{FALSE} (default), only newlines
created explicitly by \samp{\bsl{}n} are printed.  Otherwise, the
output is broken into lines with print width equal to the option
\code{width} if \code{fill} is \code{TRUE}, or the value of
\code{fill} if this is numeric.
\item[\code{labels}] character vector of labels for the lines printed.
Ignored if \code{fill} is \code{FALSE}.
\item[\code{append}] logical. Only used if the argument \code{file} is the
name of file (and not a connection or \code{"|cmd"}).
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
\code{cat} converts its arguments to character strings, concatenates
them, separating them by the given \code{sep=} string, and then
prints them.

No linefeeds are printed unless explicitly requested by \samp{\bsl{}n}
or if generated by filling (if argument \code{fill} is \code{TRUE} or
numeric.)

\code{cat} is useful for producing output in user-defined functions.
\end{Details}
\begin{Value}
None (invisible \code{NULL}).
\end{Value}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
\code{\Link{print}}, \code{\Link{format}}, and \code{\Link{paste}}
which concatenates into a string.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
iter <- rpois(1, lambda=10)
## print an informative message
cat("iteration = ", iter <- iter + 1, "\n")

## 'fill' and label lines:
cat(paste(letters, 100* 1:26), fill = TRUE,
    labels = paste("{",1:10,"}:",sep=""))
\end{ExampleCode}
\end{Examples}

