export_reports: Write the Contoso business reports to files

View source: R/reports.R

export_reportsR Documentation

Write the Contoso business reports to files

Description

Writes each report from read_reports() as a YAML file named ⁠<id>.yaml⁠, holding the metadata fields and the Markdown text in body. yaml12::read_yaml() reads a file back in one call.

Usage

export_reports(dir, overwrite = FALSE)

Arguments

dir

Directory to write to. Created if it does not exist.

overwrite

Replace files that already exist?

Value

The paths of the written files, invisibly.

Examples

dir <- file.path(tempdir(), "contoso-reports")
paths <- export_reports(dir)
yaml12::read_yaml(paths[1])$title
unlink(dir, recursive = TRUE)

contoso documentation built on Oct. 30, 2026, 9:09 a.m.