Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flextable + Shape and bind = Subheaders on the same line. #801

Open
astraetech opened this issue Aug 16, 2024 · 6 comments
Open

Flextable + Shape and bind = Subheaders on the same line. #801

astraetech opened this issue Aug 16, 2024 · 6 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@astraetech
Copy link

astraetech commented Aug 16, 2024

Hi Vincent!

Came back to modelsummary after a long while. Awesome that you are still working on it! Could you look into this please?

panels <- list(
  "Outcome: mpg" = list(
    "(I)" = lm(mpg ~ 1, data = mtcars),
    "(II)" = lm(mpg ~ qsec, data = mtcars)
  ),
  "Outcome: hp" = list(
    "(I)" = lm(hp ~ 1, data = mtcars),
    "(II)" = lm(hp ~ qsec, data = mtcars)
  )
)
        
    modelsummary(panels, shape = "cbind")
    modelsummary(panels, shape = "cbind", output=
                 "flextable")

The last line gives me the following headers: Outcome: mpg.(I) Outcome: mpg.(II) Outcome: hp.(I) Outcome: hp.(II).

loaded:
modelsummary * 2.1.0.1 2024-05-21 [1] Github (2bbbb1d)
tinytable 0.3.0.34 2024-08-12 [1] https://vincentarelbundock.r-universe.dev (R 4.4.0)

Apologis if I missed something in the vignettes.

Thank you!

@vincentarelbundock vincentarelbundock added help wanted Extra attention is needed good first issue Good for newcomers labels Aug 16, 2024
@vincentarelbundock
Copy link
Owner

Thanks for the report. Spanning column headers for shape="cbind" are only available in the default output format: tinytable.

It would be relatively easy to implement them for other formats by modifying this file: https://github.com/vincentarelbundock/modelsummary/blob/main/R/modelsummary_cbind.R

This would actually be a good first issue, so I'm adding a label to this issue.

However, in all transparency, this is not for the default output format, so I'm unlikely to implement this myself in the near future. But I'd be very happy to merge a PR if someone is interested.

@astraetech

This comment has been minimized.

@vincentarelbundock

This comment has been minimized.

@jialul

This comment has been minimized.

@vincentarelbundock

This comment has been minimized.

@jialul

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants