do_problems: Solve Problems Given a Linear Model

View source: R/operations.R

do_problemsR Documentation

Solve Problems Given a Linear Model

Description

Solve Problems Given a Linear Model

Usage

do_problems(instance, ..., more_subs = list(), .print = TRUE)

Arguments

instance

A LinRegProblem instance, which is passed as the envir argument to substitute_call.

...

Expressions or symbols to evaluate after substitution in the context of instance.

more_subs

Passed directly to substitute_call.

.print

Logical. Should the results be printed (useful if the output goes in an Rmarkdown file), or returned as a list?

Details

This function takes arbitrary expressions via ... and evaluates them in the context of a LinRegProblem instance. The results are simply printed, if print is TRUE, and otherwise returned as a list. Because substitute_call will complete partial calls, this allows for compact specification of solutions.

Value

NULL if .do_print is TRUE, otherwise a list containing results of the expressions.

Examples

X <- LinRegProblem(mtcars[, -1], mtcars[, 1], Y_transform = scale)
do_problems(X, regression_relation())

ryan-heslin/RegLesson documentation built on Aug. 5, 2022, 9:03 p.m.