Inspect a section of a ferx model (pipe-friendly)

Description

Prints the contents of a named section of a .ferx model file to the console and returns the input object invisibly so the pipe can continue.

Usage

ferx_get_section(x, section)

Arguments

  • x: A ferx_model object or a path to a .ferx file.
  • section: Name of the section to display, without brackets.

Details

When x is a ferx_model object the section is read from x$model. When x is a plain path string the call is equivalent to [ferx_model_section](ferx_model_section.qmd)(x, section).

Seealso

[ferx_model_section](ferx_model_section.qmd), [ferx_set_section](ferx_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_new](ferx_model_new.qmd)(), [ferx_model_section](ferx_model_section.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

x, invisibly.

Examples

ex <- ferx_example("warfarin")

# Inspect [parameters] and continue piping: ferx_get_section() prints
# the section and passes the ferx_model object through unchanged.
ferx_model(ex$data, ex$model) |>
  ferx_get_section("parameters")


# Mid-pipe peek: print [parameters] then fit without interrupting the chain
fit <- ferx_model(ex$data, ex$model) |>
  ferx_get_section("parameters") |>
  ferx_fit(method = "focei")