coef.modeler: Coefficients for an object of class 'modeler'

View source: R/05_coefficients.R

coef.modelerR Documentation

Coefficients for an object of class modeler

Description

Extract the estimated coefficients from an object of class modeler.

Usage

## S3 method for class 'modeler'
coef(object, id = NULL, metadata = FALSE, df = FALSE, ...)

Arguments

object

An object of class modeler, typically the result of calling the modeler() function.

id

An optional unique identifier to filter by a specific group. Default is NULL.

metadata

Logical. If TRUE, metadata is included along with the coefficients. Default is FALSE.

df

Logical. If TRUE, the degrees of freedom for the fitted model are returned alongside the coefficients. Default is FALSE.

...

Additional parameters for future functionality.

Value

A data.frame containing the model's estimated coefficients, standard errors, and optional metadata or degrees of freedom if specified.

Author(s)

Johan Aparicio [aut]

Examples

library(flexFitR)
data(dt_potato)
mod_1 <- dt_potato |>
  modeler(
    x = DAP,
    y = Canopy,
    grp = Plot,
    fn = "fn_lin_plat",
    parameters = c(t1 = 45, t2 = 80, k = 0.9),
    subset = c(15, 2, 45)
  )
print(mod_1)
coef(mod_1, id = 2)

flexFitR documentation built on April 16, 2025, 5:09 p.m.