write.table {base} | R Documentation |
Data Output
Description
write.table
prints its required argument x
(after
converting it to a data frame if it is not one already) to
file
. The entries in each line (row) are separated by the
value of sep
.
Usage
write.table(x, file = "", append = FALSE, quote = TRUE, sep = " ",
eol = "\n", na = NA, row.names = TRUE, col.names = TRUE)
Arguments
x |
the object to be written, typically a data frame. If not, it is attempted to create one from it. |
file |
the name of the file which the data are to be written to. |
sep |
the field separator string. Values on each line of the file are separated by this string. |
col.names |
a logical value indicating whether the column names
of |
row.names |
a logical value indicating whether the row names of
|
quote |
a logical or a numeric vector. If |
na |
the string to use for missing values in the data. |
eol |
the character(s) to print at the end of each line (row). |
Details
Normally there is no column name for a column of row names
If col.names=NA
a blank column name is added. This can be
used to write CSV files for input to spreadsheets.
See Also
read.table
.