write {base}
Description
The data (usually a matrix) x are written to file file. If x is a two-dimensional matrix you need to transpose it to get the columns in file the same as those in the internal representation.
Usage
write(x, file = "data",
ncolumns = if(is.character(x)) 1 else 5,
append = FALSE, sep = " ")
Arguments
- x
- the data to be written out, usually an atomic vector.
- file
- A connection, or a character string naming the file to write to. If
"", print to the standard output connection. - ncolumns
- the number of columns to write the data in.
- append
- if
TRUEthe dataxare appended to the connection. - sep
- a string used to separate columns. Using
sep = "\t"gives tab delimited output; default is" ".
References
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
See Also
write is a wrapper for cat, which gives further details on the format used.
save for writing any R objects, write.table for data frames, and scan for reading data.
Examples
Documentation reproduced from R 3.0.1. License: GPL-2.
