\HeaderA{write.matrix}{Write a Matrix or Data Frame}{write.matrix}
\keyword{file}{write.matrix}
\keyword{print}{write.matrix}
\begin{Description}\relax
Writes a matrix or data frame to a file or the console, using column
labels and a layout respecting columns.
\end{Description}
\begin{Usage}
\begin{verbatim}
write.matrix(x, file = "", sep = " ", blocksize)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] matrix or data frame.

\item[\code{file}] name of output file. The default (\code{""}) is the console.

\item[\code{sep}] The separator between columns.

\item[\code{blocksize}] If supplied and positive, the output is written in blocks of
\code{blocksize} rows.  Choose as large as possible consistent with
the amount of memory available.

\end{ldescription}
\end{Arguments}
\begin{Details}\relax
If \code{x} is a matrix, supplying \code{blocksize} is more
memory-efficient and enables larger matrices to be written, but each
block of rows might be formatted slightly differently.

If \code{x} is a data frame, the conversion to a matrix may negate the
memory saving.
\end{Details}
\begin{Section}{Side Effects}
A formatted file is produced, with column headings (if \code{x} has them)
and columns of data.
\end{Section}
\begin{References}\relax
Venables, W. N. and Ripley, B. D. (2002)
\emph{Modern Applied Statistics with S.} Fourth edition.  Springer.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{write.table}{write.table}}
\end{SeeAlso}

