sort_parameters: Sort parameters by coefficient values

View source: R/sort_parameters.R

sort_parametersR Documentation

Sort parameters by coefficient values

Description

Sort parameters by coefficient values

Usage

sort_parameters(x, ...)

## Default S3 method:
sort_parameters(x, sort = "none", column = "Coefficient", ...)

Arguments

x

A data frame or a parameters_model object.

...

Arguments passed to or from other methods.

sort

If "none" (default) do not sort, "ascending" sort by increasing coefficient value, or "descending" sort by decreasing coefficient value.

column

The column containing model parameter estimates. This will be "Coefficient" (default) in easystats packages, "estimate" in broom package, etc.

Value

A sorted data frame or original object.

Examples

# creating object to sort (can also be a regular data frame)
mod <- model_parameters(stats::lm(wt ~ am * cyl, data = mtcars))

# original output
mod

# sorted outputs
sort_parameters(mod, sort = "ascending")
sort_parameters(mod, sort = "descending")


parameters documentation built on Oct. 18, 2024, 5:13 p.m.