accessors: Accessor functions for 'breg' objects

accessorsR Documentation

Accessor functions for breg objects

Description

[Stable]

These functions provide access to components of breg objects, serving as counterparts to the ⁠br_set_*()⁠ functions. Some functions include additional arguments for extended functionality.

Usage

br_get_data(obj)

br_get_y(obj)

br_get_x(obj)

br_get_n_x(obj)

br_get_x2(obj)

br_get_n_x2(obj)

br_get_group_by(obj)

br_get_config(obj)

br_get_models(obj)

br_get_model(obj, idx)

br_get_results(obj, tidy = FALSE, ...)

Arguments

obj

A breg object.

idx

Index or names (focal variables) of the model(s) to return.

tidy

If TRUE return tidy (compact) results, otherwise return comprehensive results. The tidy results are obtained from broom::tidy() while comprehensive results are obtained from broom.helpers::tidy_plus_plus(). The results can be configured when run with br_run().

...

Subset operations passing to dplyr::filter() to filter results.

Value

Output depends on the function called:

  • br_get_data() returns a data.frame.

  • br_get_y(), br_get_x(), br_get_x2() return modeling terms.

  • br_get_n_x() and br_get_n_x2() return the length of terms x and x2.

  • br_get_group_by() returns variable(s) for group analysis.

  • br_get_config() returns modeling method and extra arguments.

  • br_get_models() returns all constructed models.

  • br_get_model() returns a subset of constructed models.

  • br_get_results() returns modeling result data.frame.

See Also

pipeline for building breg objects.

Examples

m <- br_pipeline(mtcars,
  y = "mpg",
  x = colnames(mtcars)[2:4],
  x2 = "vs",
  method = "gaussian"
)
br_get_data(m)
br_get_y(m)
br_get_x(m)
br_get_n_x(m)
br_get_x2(m)
br_get_n_x2(m)
br_get_group_by(m)
br_get_config(m)
br_get_models(m)
br_get_model(m, 1)
br_get_n_x2(m)
br_get_results(m)
br_get_results(m, tidy = TRUE)
br_get_results(m, tidy = TRUE, term == "cyl")


bregr documentation built on June 28, 2025, 5:06 p.m.