save_to_yaml: Save a psyverse object or YAML character vector to a file

View source: R/save_to_yaml.R

save_to_yamlR Documentation

Save a psyverse object or YAML character vector to a file

Description

Pretty much what it says on the box. But check the bit about encoding.

Usage

save_to_yaml(
  x,
  file,
  preventOverwriting = psyverse::opts$get("preventOverwriting"),
  encoding = psyverse::opts$get("encoding")
)

Arguments

x

The object to save.

file

The file to save to.

preventOverwriting

Whether to prevent overwriting.

encoding

The encoding to use. Note that in general, encoding seems to have been invented primarily as a source of frustration, and it rarely disappoints. If unsure, use UTF-8. If using UTF-8, the approach from https://kevinushey.github.io/blog/2018/02/21/string-encoding-and-r/ will be used.

Value

The character vector that was written to the file.


psyverse documentation built on March 7, 2023, 8:31 p.m.