vincentarelbundock / modelsummary

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

The labels in some output formats for columns are incorrect. #761

Closed ujtwr closed 2 months ago

ujtwr commented 2 months ago

Case1: kableExtra

There are extra vertical bars included in the column names.

library(tidyverse)

d <-
  tibble(
    x = rnorm(100),
    y = rnorm(100)
  )

res <- lm(y ~ x, data = d)

modelsummary::modelsummary(
  res,
  output = "kableExtra",
  estimate = c(ABC = "estimate"),
  shape = term ~ model + statistic
)

image

Case2: flextable

There are extra slash included in the column names.

library(tidyverse)

d <-
  tibble(
    x = rnorm(100),
    y = rnorm(100)
  )

res <- lm(y ~ x, data = d)

modelsummary::modelsummary(
  res,
  output = "flextable",
  estimate = c(ABC = "estimate"),
  shape = term ~ model + statistic
)

image

Case3: gt

good!!

library(tidyverse)

d <-
  tibble(
    x = rnorm(100),
    y = rnorm(100)
  )

res <- lm(y ~ x, data = d)

modelsummary::modelsummary(
  res,
  output = "gt",
  estimate = c(ABC = "estimate"),
  shape = term ~ model + statistic
)

image

ujtwr commented 2 months ago

Does this relate to anything?

https://github.com/haozhu233/kableExtra/issues/821

vincentarelbundock commented 2 months ago

Thanks for the report. This should be fixed in version 2.0.0.9 from Github.