A report profile is an ordered selection of modules used to produce an
ecological report and a data-status report. The ecological module pool is
the collection of YAML files in reportSections; the data-status module
pool is the separate collection in statusSections. These are libraries
of available modules, not lists of sections that must all be rendered.
A profile selects an ordered subset of either library. For example,
"report::introduction" selects an ecological module, whereas
"status::spatial" selects a data-status module, including when it is used
in an ecological report's appendix. These prefixes select module libraries;
they are not R namespace calls.
Arguments
- name
A non-empty profile name.
- report
An ordered set of modules for
report().- status
An ordered set of modules for
status().- description
Optional descriptive text.
- file
Path to a profile YAML file.
- profile
A
reportProfileobject, a profile name registered inobject, or a bundled profile name.write_profile()accepts either an object or a name.- overwrite
A logical value controlling whether an existing profile or file can be replaced.
- object
A
camReportobject.
Value
reportProfile() and read_profile() return a reportProfile
object. profile_names() returns a character vector. add_profile()
invisibly returns the modified camReport object, and write_profile()
invisibly returns the output path.
Details
Profile entries may be character vectors or data frames. Character entries
use "source::module" notation; unqualified entries default to the report
pool for report and the status pool for status. A data frame can also
contain a parent column to override the parent declared by a module. This
makes it possible, for example, to place status modules below an ecological
report's appendix without modifying the shared module YAML files.
Bundled profiles are registered in each object created by camData(). User
profiles can be registered with add_profile() and shared as YAML files
with read_profile() and write_profile().
See the report-profile guide
for a reusable custom profile and cross-library appendix example.
Examples
profile <- reportProfile(
name = "brief",
report = c("introduction", "results"),
status = c("abstract", "availability")
)
profile
#> Report profile: brief
#> ecological report modules: 2
#> data-status modules: 2
profile_file <- tempfile(fileext = ".yml")
write_profile(profile, profile_file)
identical(read_profile(profile_file), profile)
#> [1] TRUE
unlink(profile_file)