find_weights: Find names of model weights

View source: R/find_weights.R

find_weightsR Documentation

Find names of model weights

Description

Returns the name of the variable that describes the weights of a model.

Usage

find_weights(x, ...)

Arguments

x

A fitted model.

...

Used for objects from package survey, to pass the source argument to get_data(). See related documentation of that argument for further details.

Value

The name of the weighting variable as character vector, or NULL if no weights were specified.

Examples

data(mtcars)
mtcars$weight <- rnorm(nrow(mtcars), 1, .3)
m <- lm(mpg ~ wt + cyl + vs, data = mtcars, weights = weight)
find_weights(m)

insight documentation built on Feb. 4, 2026, 5:10 p.m.