yaml: Include a YAML header in 'write2'

Description Usage Arguments Value Author(s) See Also Examples

View source: R/yaml.R

Description

Include a YAML header in write2

Usage

1
2
3
4
5
6
7
8
9
yaml(...)

## S3 method for class 'yaml'
print(x, ...)

## S3 method for class 'yaml'
c(..., recursive = FALSE)

is.yaml(x)

Arguments

...

For yaml(), arguments to be bundled into a list and passed to as.yaml. For print.yaml(), extra arguments. For c.yaml(), "yaml" objects to be concatenated.

x

An object of class "yaml".

recursive

Not in use at this time.

Value

A text string of class "yaml".

Author(s)

Ethan Heinzen, adapted from an idea by Brendan Broderick

See Also

as.yaml, write2

Examples

1
2
3
4
5
x <- yaml(title = "My cool title", author = "Ethan P Heinzen")
x
y <- yaml("header-includes" = list("\\usepackage[labelformat=empty]{caption}"))
y
c(x, y)

Example output

---
title: My cool title
author: Ethan P Heinzen
---
---
header-includes:
- \usepackage[labelformat=empty]{caption}
---
---
title: My cool title
author: Ethan P Heinzen
header-includes:
- \usepackage[labelformat=empty]{caption}
---

arsenal documentation built on June 5, 2021, 1:06 a.m.