[ top | up ]

Data Output

Usage

write.table(x, file = "", sep =" ", col.names = TRUE, 
            row.names = TRUE, quote = FALSE, na = NA, 
            eol = "\n")

Arguments

x a data frame, matrix or vector of data.
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 x are to be written along with x, or a character vector of column names to be written.
row.names a logical value indicating whether the row names of x are to be written along with x, or a character vector of row names to be written.
quote a logical or a numeric vector. If TRUE, any strings in the data will be surrounded by double quotes. If a numeric vector, its elements are taken as the indices of the variable (columns) to quote. In both cases, row and columns names are always quoted if they are written.
na the string to use for missing values in the data.
eol the character(s) to print at the end of each line (row).

Description

write.table converts its required argument x to a matrix and prints it to file. The entries in each line (row) are separated by the value of sep.

See Also

read.table.