Skip to contents

[Experimental] Extracts module labels from a teal modules object, filters out parent modules (grouping containers), and generates a YAML file with the functional modules.

Usage

extract_modules_to_yaml(mods, filepath, verbose = FALSE)

Arguments

mods

(teal_module or teal_modules) a teal modules object containing the module structure.

filepath

(character(1)) character string specifying the output YAML file path.

verbose

(logical(1)) whether to print informational messages. Default is FALSE.

Value

Character vector of non-parent module labels

Examples

# Extract modules from mods object to YAML file
mods <- teal::modules(
  teal::example_module("mod1"),
  teal::example_module("mod2")
)
labels <- extract_modules_to_yaml(mods, "panel_str_modules.yml")
unlink("panel_str_modules.yml")

# Clean up
if (file.exists("panel_str_modules.yml")) {
  file.remove("panel_str_modules.yml")
}