Note that this assumes only one Yaml header, starting on the first line of the file.
get_yaml_header(file, yaml_rxp = "^\\#*---[[:space:]]*$", verbose = TRUE)
A character string or R connection specifying a file.
Regular expression for parsing YAML header
Logical. If TRUE
, print warning if no header found.
Character vector of lines containing YAML header, or `NULL` if no YAML header found.