Comments (7)
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.
{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.
---
title: "test"
format: pdf
---
```{r}
library(gtsummary)
trial %>%
select(age, grade, trt) %>%
tbl_summary(by = trt)
The last line was missing.
from gtsummary.
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:
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.
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.
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?
from gtsummary.
Thanks @Melkiades for investigating!
I would check two things:
- Is it the introduction on the line break in the header that is causing the formatting issue.
- 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)
- Bug Report: `inline_text(column)` argument doesn't work with fct by level names HOT 2
- Bug Report: Variable defined as covariate in `tbl_uvregression` is reported in table output HOT 2
- update stackoverflow posts HOT 2
- Error when using tbl_summary with odd-values in character variable with a non-character "by" variable HOT 2
- Make doc more clear on `p.std.error` in `tbl_svysummary()` scale
- I
- I can't see the table in viewer HOT 2
- Bug Report: new version of gtsummary struggles with hms types HOT 3
- Increase width of column in Markdown vignette
- Bug Report: Decimals of tbl_summary wrongly displayed HOT 1
- Feature request: More adjustments for missing values HOT 4
- Update hex shown in website tab preview
- Bug Report: Ruler appears in the wrong place using `tbl_cross()` for Quarto html output HOT 4
- Release gtsummary 2.0.1
- Support for multiple source notes within gtsummary
- Bug Report: tbl_svysummary modify_header not recognising {N_unweighted} HOT 1
- Bug report: gtsummary v 2.0.0 (and 2.0.1) no longer supports add_glance_table() for mice objects HOT 2
- Bug Report: Missing Confidence Intervals and P-Values in tbl_regression for Survey Design with Many Independent Variables HOT 3
- Bug Report: Errors in lapply function tbl_summary after updating HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtsummary.