Exports a data.frame as comma-separated variable,
as well as a yamlet version of its decorations.
A wrapper for as.csv.data.frame.
Arguments
- x
data.frame
- file
passed to
as.csv.data.frame(by method dispatch)- ext
= extension for metadata equivalent of x
- meta
passed as
contoio_yamlet- gz
logical; guessed by default from
x; if TRUE, '.gz' extension enforced present for (character)fileand absent for defaultmeta- useBytes
passed to
io_yamlet- default_keys
passed to
io_yamlet- ...
Details
You should be able to supply exactly the connections you want for
file (the data file) and meta (the metadata file)
if gz is FALSE. If gz is NULL, it will be
guessed from file (TRUE for character ending with '.gz' or '.GZ').
If TRUE, character file will have '.gz' extension enforced,
but any '.gz' ('.GZ') will be stripped when calculating meta.
See also
Other io:
io_csv(),
io_csv.character(),
io_res(),
io_res.character(),
io_res.decorated(),
io_table(),
io_table.character(),
io_table.data.frame(),
io_yamlet(),
io_yamlet.character(),
io_yamlet.data.frame(),
io_yamlet.yamlet()
Other interface:
canonical.decorated(),
classified.data.frame(),
decorate.character(),
decorate.data.frame(),
desolve.decorated(),
enscript.decorated(),
ggplot.decorated(),
io_csv.character(),
io_res.character(),
io_res.decorated(),
io_table.character(),
io_table.data.frame(),
io_yamlet.character(),
io_yamlet.data.frame(),
is_parseable.default(),
mimic.default(),
modify.default(),
promote.list(),
read_yamlet(),
resolve.decorated(),
selected.default(),
write_yamlet()
Examples
example(io_csv)
#>
#> io_csv> # generate some decorated data
#> io_csv> file <- system.file(package = 'yamlet', 'extdata','quinidine.csv')
#>
#> io_csv> x <- decorate(file)
#>
#> io_csv> # get a temporary filepath
#> io_csv> out <- file.path(tempdir(), 'out.csv')
#>
#> io_csv> # save file using io_csv (returns filepath)
#> io_csv> foo <- io_csv(x, out)
#>
#> io_csv> stopifnot(identical(out, foo))
#>
#> io_csv> # read using this filepath
#> io_csv> y <- io_csv(foo)
#>
#> io_csv> # lossless round-trip (ignoring source attribute)
#> io_csv> attr(x, 'source') <- NULL
#>
#> io_csv> attr(y, 'source') <- NULL
#>
#> io_csv> stopifnot(identical(x, y))