fail_safe_formula: Safely extract the formula from an object

View source: R/utilities.R

fail_safe_formulaR Documentation

Safely extract the formula from an object

Description

Safely extract the formula from an object

Usage

fail_safe_formula(fm, method.args = list(), verbose = TRUE)

Arguments

fm

Fitted model object or a call object.

method.args

List of arguments to check for the formula.

verbose

logical If TRUE message triggered if call to formula() fails.

Details

Method formula is not implemented for all fitted model objects, while the default method triggers an error and stops exectution. Function fail_safe_formula() wraps the call to formula() and handles the error conditions by attempting to extract the formula from a list of arguments. If this fails, it returns NA, with a message.

Value

A named list with objects of class formula or NA as member(s).


ggpmisc documentation built on Nov. 16, 2023, 5:10 p.m.