vincentarelbundock / modelsummary

Beautiful and customizable model summaries in R.
http://modelsummary.com
Other
911 stars 75 forks source link

Splitting term category into term and term-value? #746

Closed iago-pssjd closed 5 months ago

iago-pssjd commented 6 months ago

I have just discovered in https://modelsummary.com/vignettes/modelsummary.html#formula the feature

We can combine the term and group identifier columns by inserting an interaction colon : instead of the + in the formula:

Would it be possible the opposite feature, so for example for

datlab <- mtcars
datlab$cyl <- factor(datlab$cyl)
attr(datlab$cyl, "label") <- "Cylinders"
attr(datlab$am, "label") <- "Transmission"
modlab <- lm(mpg ~ cyl + am, data = datlab)
modelsummary(modlab, coef_rename = TRUE)

Cylinders and the other terms would appear in a column, but the factor values [6] and [8] would appear in another column?

vincentarelbundock commented 5 months ago

No, sorry, I won't implement this.

I would consider a code contribution, but if someone wants to contribute this, they should open an issue and discuss in very specific terms how they plan to implement this, because I'm not convinced this will be easy or generate a good user interface.