Learn R Programming

icesTAF (version 3.6.0)

write.taf: Write TAF Table to File

Description

Write a TAF table to a file.

Usage

write.taf(x, file = NULL, dir = NULL, quote = FALSE, row.names = FALSE,
  fileEncoding = "UTF-8", underscore = TRUE, ...)

Arguments

x

a data frame in TAF format.

file

a filename.

dir

an optional directory name.

quote

whether to quote strings.

row.names

whether to include row names.

fileEncoding

character encoding for output file.

underscore

whether automatically generated filenames (when file = NULL) should use underscore separators instead of dots.

...

passed to write.csv.

Details

Alternatively, x can be a list of data frames or a string vector of object names, to write many tables in one call. The resulting files are named automatically, similar to file = NULL.

The default value file = NULL uses the name of x as a filename, so a data frame called survey.uk will be written to a file called survey_uk.csv (when underscore = TRUE) or survey.uk.csv (when underscore = FALSE).

The special value file = "" prints the data frame in the console, similar to write.csv.

References

IETF (2005) Common format and Mime type for Comma-Separated Values (CSV) files. IETF RFC 4180.

See Also

write.csv is the underlying function used to write a table to a file.

read.taf reads a TAF table from a file into a data frame.

icesTAF-package gives an overview of the package.

Examples

Run this code
if (FALSE) {
write.taf(catage.taf, "catage.csv")
catage <- read.taf("catage.csv")

write.taf(catage)
file.remove("catage.csv")
}

Run the code above in your browser using DataLab