Learn R Programming

teal.reporter (version 0.4.0)

get_yaml_field: Extract field from yaml text

Description

Parses yaml text, extracting the specified field. Returns list names if it's a list; otherwise, the field itself.

Usage

get_yaml_field(yaml_text, field_name)

Value

If the field is a list, it returns the names of elements in the list; otherwise, it returns the extracted field.

Arguments

yaml_text

(rmd_yaml_header or character) vector containing the yaml text.

field_name

(character) the name of the field to extract.