Learn R Programming

csvy (version 0.3.0)

write_csvy: Export CSVY data

Description

Export data.frame to CSVY

Usage

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

Run this code
# NOT RUN {
library("datasets")
write_csvy(head(iris))

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

# }

Run the code above in your browser using DataLab