Git Product home page Git Product logo

Comments (7)

philippemichel avatar philippemichel commented on August 28, 2024 1

The result is quite correct with the following code (gtsummary v2.0) :

---
title: "TEST"
format: pdf
---

```{r}
library(gtsummary)

trial |>
  tbl_summary(
    by = trt
  ) |>
  as_kable()
```z

("z" is here for not close the block code with the triple`, to clear)

from gtsummary.

Melkiades avatar Melkiades commented on August 28, 2024

{gtsummary} does not show any issue in your reprex. It regards your quarto code or system env. Please also consider reading again the guidelines for posting issues, thanks!!

from gtsummary.

philippemichel avatar philippemichel commented on August 28, 2024

---
title: "test"
format: pdf
---

```{r}
library(gtsummary)

trial %>%
  select(age, grade, trt) %>%
 tbl_summary(by = trt)

The last line was missing.

from gtsummary.

DanChaltiel avatar DanChaltiel commented on August 28, 2024

I have the same bug on Windows 10.

I cannot use reprex with Quarto so I'm not sure how to share a reproducible example.

Therefore, here is the output as an image, see that the header is misconstructed:
image

And here are my versions:

packageVersion("gt")
#> [1] '0.11.0'
packageVersion("gtsummary")
#> [1] '2.0.0'
quarto::quarto_version()
#> [1] '1.5.56'

Created on 2024-08-09 with reprex v2.1.0

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.3.3 (2024-02-29 ucrt)
#>  os       Windows 10 x64 (build 19045)
#>  system   x86_64, mingw32
#>  ui       RTerm
#>  language en
#>  collate  French_France.utf8
#>  ctype    French_France.utf8
#>  tz       Europe/Paris
#>  date     2024-08-09
#>  pandoc   3.1.11 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date (UTC) lib source
#>  cli           3.6.2   2023-12-11 [1] CRAN (R 4.3.3)
#>  digest        0.6.35  2024-03-11 [1] CRAN (R 4.3.3)
#>  evaluate      0.23    2023-11-01 [1] CRAN (R 4.3.2)
#>  fastmap       1.1.1   2023-02-24 [1] CRAN (R 4.3.2)
#>  fs            1.6.3   2023-07-20 [1] CRAN (R 4.3.2)
#>  glue          1.7.0   2024-01-09 [1] CRAN (R 4.3.3)
#>  htmltools     0.5.7   2023-11-03 [1] CRAN (R 4.3.2)
#>  jsonlite      1.8.7   2023-06-29 [1] CRAN (R 4.3.2)
#>  knitr         1.46    2024-04-06 [1] CRAN (R 4.3.3)
#>  later         1.3.1   2023-05-02 [1] CRAN (R 4.3.2)
#>  lifecycle     1.0.4   2023-11-07 [1] CRAN (R 4.3.2)
#>  magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.3.2)
#>  processx      3.8.2   2023-06-30 [1] CRAN (R 4.3.2)
#>  ps            1.7.5   2023-04-18 [1] CRAN (R 4.3.2)
#>  purrr         1.0.2   2023-08-10 [1] CRAN (R 4.3.2)
#>  quarto        1.4     2024-03-06 [1] CRAN (R 4.3.3)
#>  R.cache       0.16.0  2022-07-21 [1] CRAN (R 4.3.2)
#>  R.methodsS3   1.8.2   2022-06-13 [1] CRAN (R 4.3.1)
#>  R.oo          1.25.0  2022-06-12 [1] CRAN (R 4.3.1)
#>  R.utils       2.12.3  2023-11-18 [1] CRAN (R 4.3.3)
#>  Rcpp          1.0.12  2024-01-09 [1] CRAN (R 4.3.3)
#>  reprex        2.1.0   2024-01-11 [1] CRAN (R 4.3.3)
#>  rlang         1.1.3   2024-01-10 [1] CRAN (R 4.3.3)
#>  rmarkdown     2.27    2024-05-17 [1] CRAN (R 4.3.3)
#>  rstudioapi    0.15.0  2023-07-07 [1] CRAN (R 4.3.2)
#>  sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.3.2)
#>  styler        1.10.3  2024-04-07 [1] CRAN (R 4.3.3)
#>  vctrs         0.6.5   2023-12-01 [1] CRAN (R 4.3.3)
#>  withr         3.0.0   2024-01-16 [1] CRAN (R 4.3.3)
#>  xfun          0.43    2024-03-25 [1] CRAN (R 4.3.3)
#>  yaml          2.3.8   2023-12-11 [1] CRAN (R 4.3.2)
#> 
#>  [1] C:/Users/Dan/AppData/Local/R/win-library/4.3
#>  [2] C:/Program Files/R/R-4.3.3/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────

from gtsummary.

ddsjoberg avatar ddsjoberg commented on August 28, 2024

Can you install gt v0.10.1 and see if you get the same result? I think this looks like a gt+Quarto issue perhaps?

from gtsummary.

DanChaltiel avatar DanChaltiel commented on August 28, 2024

Same result with gt v0.10.1.
However, the problem disappears with gtsummary v1.7.2.
The fact that it used kable instead of gt might be an important hint. Maybe we can use that in v2?
image

from gtsummary.

ddsjoberg avatar ddsjoberg commented on August 28, 2024

Thanks @Melkiades for investigating!

I would check two things:

  1. Is it the introduction on the line break in the header that is causing the formatting issue.
  2. If not, check the result using gt 0.10.1 and again with gtsummary 1.7.2. When testing the older gtsummary, ensure you force the drawing of the table with gt (rather than the default kable printer)

from gtsummary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.