r_squared: Get the R2 of a fitted allometric model

View source: R/r_squared.R

r_squaredR Documentation

Get the R2 of a fitted allometric model

Description

Wraps performance::r2(), which returns the R2 suited to the model it is given, so that any kind of model can be filtered the same way in full_estimation_table()

Usage

r_squared(model)

Arguments

model

A fitted allometric model

Value

A single R2 value, NA if none could be computed

Examples

# Any allometric model will do
mod <-
  lm(log10(biomass_col) ~ log10(size_col),
     data = data.frame(size_col = c(1, 2, 3, 4, 5),
                       biomass_col = c(0.1, 0.5, 1.2, 2.4, 4.1)))

r_squared(mod)

hellometry documentation built on Nov. 11, 2026, 5:06 p.m.