write_yamlet: Write Yamlet

Description Usage Arguments Value See Also Examples

View source: R/yamlet.R

Description

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

Usage

1
2
3
4
5
6
7
8
9
write_yamlet(
  x,
  con = stdout(),
  eol = "\n",
  useBytes = FALSE,
  default_keys = getOption("yamlet_default_keys", list("label", "guide")),
  fileEncoding = getOption("encoding"),
  ...
)

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

...

passed to as_yamlet

Value

invisible character representation of yamlet (storage syntax)

See Also

decorate.list

Other interface: as.data.frame.yamlet(), 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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))

yamlet documentation built on July 19, 2021, 1:06 a.m.