1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
% file MASS/write.matrix.d
% copyright (C) 1994-2002 W. N. Venables and B. D. Ripley
%
\name{write.matrix}
\alias{write.matrix}
\title{
Write a Matrix or Data Frame
}
\description{
Writes a matrix or data frame to a file or the console, using column
labels and a layout respecting columns.
}
\usage{
write.matrix(x, file = "", sep = " ", blocksize)
}
\arguments{
\item{x}{
matrix or data frame.
}
\item{file}{
name of output file. The default (\code{""}) is the console.
}
\item{sep}{
The separator between columns.
}
\item{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.
}}
\details{
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.
}
\section{Side Effects}{
A formatted file is produced, with column headings (if \code{x} has them)
and columns of data.
}
\references{
Venables, W. N. and Ripley, B. D. (2002)
\emph{Modern Applied Statistics with S.} Fourth edition. Springer.
}
\seealso{
\code{\link{write.table}}
}
\keyword{file}
\keyword{print}
|