Learn R Programming

parameters (version 0.22.0)

sort_parameters: Sort parameters by coefficient values

Description

Sort parameters by coefficient values

Usage

sort_parameters(x, ...)

# S3 method for default sort_parameters(x, sort = "none", column = "Coefficient", ...)

Value

A sorted data frame or original object.

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.

Examples

Run this code
# 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")

Run the code above in your browser using DataLab