Learn R Programming

R.utils (version 2.12.3)

writeDataFrame.data.frame: Writes a data.frame to tabular text file

Description

Writes a data.frame to tabular text file with an optional header.

Usage

# S3 method for data.frame
writeDataFrame(data, file, path=NULL, sep="\t", quote=FALSE, row.names=FALSE,
  col.names=!append, ..., header=list(), createdBy=NULL,
  createdOn=format(Sys.time(), format = "%Y-%m-%d %H:%M:%S %Z"),
  nbrOfRows=nrow(data), headerPrefix="# ", headerSep=": ", append=FALSE, overwrite=FALSE)

Value

Returns (invisibly) the pathname to the file written (or the connection written to).

Arguments

data

A data.frame.

file

A connection or a filename to write to.

path

The directory where the file will be written.

sep, quote, row.names, col.names, ...

Additional arguments passed to write.table.

header

An optional named list of header rows to be written at the beginning of the file. If NULL, no header will be written.

createdBy, createdOn, nbrOfRows

If non-NULL, common header rows to be added to the header.

headerPrefix

A character string specifying the prefix of each header row.

headerSep

A character string specifying the character separating the header name and header values.

append

If TRUE, the output is appended to an existing file.

overwrite

If TRUE, an existing file is overwritten.

Author

Henrik Bengtsson

See Also

write.table. readTable().