-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
07_alignment.qmd
69 lines (45 loc) · 1.38 KB
/
07_alignment.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
title: "Alignment"
format: html
editor: visual
---
## Testing Alignments output
```{r eval=FALSE}
library(gtsummary)
tbl <- gtsummary::tbl_summary(gtsummary::trial, by = trt, include = c(age, grade), missing = "always", label = list(age = "Age")) |> add_overall()
gt_table <- tbl$table_body |>
gt::gt(caption = gt::md("This is the caption \n[Used for cross referencing in Quarto]")) |>
gt::cols_align(columns = c(stat_1, stat_2), align = "right") |>
gt::cols_align(columns = c(variable, var_type), align = "center") |>
gt::cols_align(columns = c(row_type, var_label), align = "left")
```
### gt_save PDF
```{r eval = FALSE}
gt::gtsave(gt_table, filename = "outputs/pdf/alignment_gt_pdf.pdf")
```
[Preview the Output](outputs/pdf/alignment_gt_pdf.pdf)
- no issues
### rmarkdown rendered PDF
```{r eval = FALSE}
gt_table
```
[Preview the Output](outputs/pdf/alignment_rmd_pdf.pdf)
- no issues
### gt_save rendered word file
```{r eval = FALSE}
gt::gtsave(gt_table, filename = "outputs/docx/alignment_gt_word.docx")
```
[Preview the Output](outputs/docx/alignment_gt_word.docx)
- no issues
### quarto rendered word file
```{r eval = FALSE}
gt_table
```
[Preview the Output](outputs/docx/alignment_qmd_word.docx)
- no issues
### rmarkdown rendered word file
```{r eval = FALSE}
gt_table
```
[Preview the Output](outputs/docx/alignment_rmd_word.docx)
- no issues