unnest_modelsummary_list: Unnest a 'modelsummary_list' column

View source: R/modelsummary.R

unnest_modelsummary_listR Documentation

Unnest a modelsummary_list column

Description

Unnest a nested data frame with a modelsummary_list column by adding tidy and glance columns.

Usage

unnest_modelsummary_list(data, col = "model", remove = TRUE)

Arguments

data

A data.frame

col

Name of the modelsummary_list column, a character vector of length one.

remove

If ‘TRUE’, remove input column from output data frame.

Details

A modelsummary_list object can be directly used to print regression tables but needs to be unnested for further processing, e.g. for plotting from the "tidy" data.frame. tidyr::unnest_wider() doesn't work for objects of this type, and it cannot be extended with custom methods. This function reimplements unnesting in a simple case.

Value

The original data.frame with two added columns, optionally the input column removed.


svraka/asmisc documentation built on June 12, 2025, 12:04 p.m.