vincentarelbundock / modelsummary

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

` output="latex" ` and `kableExtra` #776

Closed nmwitzig closed 3 weeks ago

nmwitzig commented 3 weeks ago

Hi!

I used to be able to do something like this

library(modelsummary)

url <- 'https://vincentarelbundock.github.io/Rdatasets/csv/HistData/Guerry.csv'
dat <- read.csv(url)

models <- list(
  "OLS 1"     = lm(Donations ~ Literacy + Clergy, data = dat),
  "Poisson" = glm(Donations ~ Literacy + Commerce, family = poisson, data = dat),
  "OLS 2"     = lm(Crime_pers ~ Literacy + Clergy, data = dat)
)

modelsummary(models, output = "latex") %>%
  kable_styling(full_width = F)

But now I get an error "Error in if (kable_format %in% c("pipe", "markdown")) { : argument is of length zero"

I want to ultimately export to latex, while being able to adjust via 'kableExtra' beforehand.

Thank you!

vincentarelbundock commented 3 weeks ago

Please read the message that modelsummary prints every time library(modelsummary) is called, as well as the NEWS item for version 2.0.0: https://github.com/vincentarelbundock/modelsummary/blob/main/NEWS.md#200