write(x, file="data", ncolumns=<<see below>>, append=F)
NA
s) are allowed.
file
.
Default is 5 per line for numeric data, 1 per line for
character data.
file
?
Because of the way matrix data is stored,
matrices are written in column by column order.
The result is equivalent to a S-PLUS vector -- the
ncol
argument states
the user's preference and is unrelated to the dimensions of the matrix.
Missing values are written as
NA
, Infinities as plus or minus
Inf
, and
"Not a Numbers" as
NaN
.
write(round(x, 3), "filex") # write matrix row by row write(t(x), file="x.byrows", ncol=ncol(x))