knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file()) # Set WD to Root here::i_am("dev/yaml.Rmd") library(here) library(yaml)
yaml.load("thai_font: Laksaman") # If YAML field empty return `NULL` yaml.load("thai_font: ")
suppressWarnings(read_yaml(here("dev/test_data/config.yml")))
Must suppress EOL warning from readLines()
, unless specified n
(which not have)
readLines(here("dev/test_data/config.yml"), warn = T)
yaml::write_yaml(list(thai_font = "Angsana New"), file = here("dev/test_data/config2.yml")) yaml::read_yaml(here("dev/test_data/config2.yml"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.