as_yml is a wrapper for yaml::yaml.load() that stores YAML as a yml object, which prints cleanly to the console and is easy to work with using ymlthis functions.

as_yml(x)

Arguments

x

An object, either a character vector of length 1 or list, to convert to yml.

Value

a yml object

Examples


x <- as_yml("
  author: Hadley Wickham
  date: '2014-09-12'
  title: Tidy Data
  keywords:
  - data cleaning
  - data tidying
  - relational databases
  - R")

  x
#> ---
#> author: Hadley Wickham
#> date: '2014-09-12'
#> title: Tidy Data
#> keywords:
#> - data cleaning
#> - data tidying
#> - relational databases
#> - R
#> ---
#> 

  x %>%
    yml_subtitle("Hadley's Tidy Data Paper")
#> ---
#> author: Hadley Wickham
#> date: '2014-09-12'
#> title: Tidy Data
#> keywords:
#> - data cleaning
#> - data tidying
#> - relational databases
#> - R
#> subtitle: Hadley's Tidy Data Paper
#> ---
#>