Extract a section from a ferx model file

Description

Returns the lines belonging to a named section of a .ferx model file, excluding the section header itself. Prints the lines to the console and returns them invisibly.

Usage

ferx_model_section(path, section, strip = FALSE)

Arguments

  • path: Path to a .ferx model file.
  • section: Name of the section to extract, without brackets (e.g. "parameters").
  • strip: Logical. If TRUE, leading whitespace is trimmed from each returned line via trimws. Defaults to FALSE to preserve the round-trip guarantee with [ferx_model_set_section](ferx_model_set_section.qmd).

Seealso

[ferx_model_show](ferx_model_show.qmd), [ferx_model_edit](ferx_model_edit.qmd), [ferx_model_set_section](ferx_model_set_section.qmd)Other model-editing: [ferx_get_section](ferx_get_section.qmd)(), [ferx_model](ferx_model.qmd)(), [ferx_model_edit](ferx_model_edit.qmd)(), [ferx_model_inspect](ferx_model_inspect.qmd)(), [ferx_model_new](ferx_model_new.qmd)(), [ferx_model_set_section](ferx_model_set_section.qmd)(), [ferx_model_show](ferx_model_show.qmd)(), [ferx_model_validate](ferx_model_validate.qmd)(), [ferx_set_section](ferx_set_section.qmd)()

Concept

model-editing

Value

Character vector of lines in the requested section, invisibly.

Examples

ex <- ferx_example("warfarin")
ferx_model_section(ex$model, "parameters")
ferx_model_section(ex$model, "parameters", strip = TRUE)