Get a section from a ferx model

Description

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

Usage

ferx_model_get_section(x, section, strip = FALSE)

Arguments

  • x: A ferx_model object or a path to a .ferx 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_model](ferx_model.qmd)(), [ferx_model_edit](ferx_model_edit.qmd)(), [ferx_model_inspect](ferx_model_inspect.qmd)(), [ferx_model_set_section](ferx_model_set_section.qmd)(), [ferx_model_show](ferx_model_show.qmd)(), [ferx_model_validate](ferx_model_validate.qmd)()

Concept

model-editing

Value

Character vector of lines in the requested section, invisibly.

Examples

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

m <- ferx_model(ex$data, ex$model)
ferx_model_get_section(m, "parameters")