Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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 class '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)

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.

Value

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

Author(s)

Henrik Bengtsson

See Also


R.utils

Various Programming Utilities

v2.10.1
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.