write_csvy: Export CSVY data

Description Usage Arguments See Also Examples

View source: R/write_csvy.R

Description

Export data.frame to CSVY

Usage

1
2
3
write_csvy(x, file, metadata = NULL, sep = ",", dec = ".",
  comment_header = if (is.null(metadata)) TRUE else FALSE,
  name = deparse(substitute(x)), metadata_only = FALSE, ...)

Arguments

x

A data.frame.

file

A character string or R connection specifying a file.

metadata

Optionally, a character string specifying a YAML (“.yaml”) or JSON (“.json”) file to write the metadata (in lieu of including it in the header of the file).

sep

A character string specifying a between-field separator. Passed to fwrite.

dec

A character string specifying a within-field separator. Passed to fwrite.

comment_header

A logical indicating whether to comment the lines containing the YAML front matter. Default is TRUE.

name

A character string specifying a name for the dataset.

metadata_only

A logical indicating whether only the metadata should be produced (no CSV component).

...

Additional arguments passed to fwrite.

See Also

write_csvy

Examples

1
2
3
4
5
library("datasets")
write_csvy(head(iris))

# write yaml w/o comment charaters
write_csvy(head(iris), comment_header = FALSE)

csvy documentation built on May 2, 2019, 2:09 a.m.