write.taf: Write TAF Table

View source: R/write.taf.R

write.tafR Documentation

Write TAF Table

Description

Write a data frame to a CSV file.

Usage

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

Arguments

x

a data frame.

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.

Value

No return value, called for side effects.

Note

This function gives a warning when column names are missing or duplicated, unless the target directory name is ⁠report⁠. It also gives a warning if the data frame has zero rows.

See Also

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

read.taf reads from a CSV file into a data frame.

taf2html converts a data frame to HTML.

TAF-package gives an overview of the package.

Examples

## Not run: 
write.taf(catage.taf, "catage.csv")
catage <- read.taf("catage.csv")

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

## End(Not run)


ices-tools-prod/TAF documentation built on April 17, 2025, 2:02 p.m.