Learn R Programming

yamlet (version 0.8.5)

write_yamlet: Write Yamlet

Description

Writes yamlet to file. Similar to io_yamlet.yamlet but returns invisible storage format instead of invisible storage location.

Usage

write_yamlet(
  x,
  con = stdout(),
  eol = "\n",
  useBytes = FALSE,
  default_keys = getOption("yamlet_default_keys", list("label", "guide")),
  fileEncoding = getOption("encoding"),
  block = FALSE,
  ...
)

Arguments

x

something that can be coerced to class 'yamlet', like a yamlet object or a decorated data.frame

con

passed to writeLines

eol

end-of-line; passed to writeLines as sep

useBytes

passed to writeLines

default_keys

character: default keys for the first n anonymous members of each element

fileEncoding

if con is character, passed to file as encoding

block

whether to write block scalars

...

Value

invisible character representation of yamlet (storage syntax)

See Also

decorate.list

Other interface: as.data.frame.yamlet(), canonical.decorated(), classified.data.frame(), decorate.character(), decorate.data.frame(), desolve.decorated(), ggplot.decorated(), io_csv.character(), io_csv.data.frame(), io_res.character(), 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()

Examples

Run this code
# NOT RUN {
library(csv)
file <- system.file(package = 'yamlet', 'extdata','quinidine.csv')
meta <- system.file(package = 'yamlet', 'extdata','quinidine.yaml')
x <- as.csv(file)
y <- read_yamlet(meta)
x <- decorate(x, meta = y)
identical(x, decorate(file))
tmp <- tempfile()
write_yamlet(x, tmp)
identical(read_yamlet(meta), read_yamlet(tmp))
# }

Run the code above in your browser using DataLab