我想将我的
gtsummary
表格转换为 gt
表格,并最终转换为乳胶,同时仍保持缩进。保持压痕的简单方法是什么?
library(gtsummary)
library(gt)
trial[c("trt", "age", "response", "grade")] %>%
tbl_summary(by = trt) %>%
as_gt() |>
as_latex() |>
as.character() |>
cat()
输出:
\setlength{\LTpost}{0mm}
\begin{longtable}{lcc}
\toprule
\textbf{Characteristic} & \textbf{Drug A}, N = 98\textsuperscript{\textit{1}} & \textbf{Drug B}, N = 102\textsuperscript{\textit{1}} \\
\midrule
Age & 46 (37, 59) & 48 (39, 56) \\
Unknown & 7 & 4 \\
Tumor Response & 28 (29\%) & 33 (34\%) \\
Unknown & 3 & 4 \\
Grade & & \\
I & 35 (36\%) & 33 (32\%) \\
II & 32 (33\%) & 36 (35\%) \\
III & 31 (32\%) & 33 (32\%) \\
\bottomrule
\end{longtable}
\begin{minipage}{\linewidth}
\textsuperscript{\textit{1}}Median (IQR); n (\%)\\
\end{minipage}