Writes a matrix or data frame to a file or the console, using column labels and a layout respecting columns.
write.matrix(x, file = "", sep = " ", blocksize)
- matrix or data frame.
name of output file. The default (
"") is the console.
- The separator between columns.
If supplied and positive, the output is written in blocks of
blocksizerows. Choose as large as possible consistent with the amount of memory available.
x is a matrix, supplying
blocksize is more
memory-efficient and enables larger matrices to be written, but each
block of rows might be formatted slightly differently. If
x is a data frame, the conversion to a matrix may negate the
A formatted file is produced, with column headings (if
x has them)
and columns of data.
Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.