write_yaml

0th

Percentile

Write a YAML file

Write the YAML representation of an R object to a file

Keywords
manip, data
Usage
write_yaml(x, file, fileEncoding = "UTF-8", …)
Arguments
x

the object to be converted

file

either a character string naming a file or a connection open for writing

fileEncoding

character string: if non-empty declares the encoding to be used on a file (not a connection) so the character data can be re-encoded as they are written. See file.

arguments to as.yaml

Details

If file is a non-open connection, an attempt is made to open it and then close it after use.

This function is a convenient wrapper around as.yaml.

See Also

as.yaml, read_yaml, yaml.load_file

Aliases
  • write_yaml
Examples
# NOT RUN {
  # writing to a file connection
  con <- file("data.yml", "w")
  write_yaml(data.frame(a=1:10, b=letters[1:10], c=11:20), con)

  # using a filename to specify output file
  write_yaml(data.frame(a=1:10, b=letters[1:10], c=11:20), "data.yml")
# }
Documentation reproduced from package yaml, version 2.1.18, License: BSD_3_clause + file LICENSE

Community examples

Looks like there are no examples yet.