vincentarelbundock / modelsummary

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

FR: allow `coef_rename` and `coef_map` simultaneous use when `coef_rename = TRUE` #747

Closed iago-pssjd closed 5 months ago

iago-pssjd commented 6 months ago

If coef_rename = TRUE, I am asking just for using label attribute of the corresponding variables, then coef_map should be allowed to reorder the variables.

Thanks!

vincentarelbundock commented 6 months ago

It should still work. Make sure you use the raw coef names, not the transformed ones.

iago-pssjd commented 6 months ago

I do, but I get

Error in sanity_coef(coef_map, coef_rename, coef_omit) : 
  coef_map and coef_rename cannot be used together.
vincentarelbundock commented 5 months ago

Thanks for the report. Should be fixed now on Github.

iago-pssjd commented 5 months ago

Dear @vincentarelbundock,

I also tested this just now. I see it works, however, when the variables are factors, in coef_map one has to specify each value of the factor. See again this example screenshot

image

One must specify in coef_map, "Age [from31to40]" and all others ageL categories.

It would be better if one could specify just the variable label (e.g. Age) or even better the variable name (ageL). Would some of these options be possible?

Thanks a lot!

vincentarelbundock commented 5 months ago

I can't think of an easy way to implement this right now, unfortuantely.