在使用tbl_summary时,应确保输入的数据框格式正确,变量命名无误。 如果数据中包含缺失值,tbl_summary默认会将其排除在统计之外,可以通过参数调整这一行为。 通过上述函数和说明,你应该能够在 R 中为tbl_summary创建一个自定义的函数,并根据需要进行调整和使用。
ggsave("summary.png", gg, width = 8, height = 6, dpi = 300) 这样,tbl_summary生成的表格摘要就会以png格式保存在指定的文件路径中。 需要注意的是,以上方法是使用ggplot2包将tbl_summary导出为png的一种替代方法。根据具体需求,也可以使用其他R包或自定义函数来实现类似的功能。相关搜索: 在R中将多个Sha...
## [37] rlang_1.0.2 readxl_1.4.0 rstudioapi_0.13 ## [40] generics_0.1.2 jsonlite_1.8.0 zip_2.2.0 ## [43] magrittr_2.0.3 kableExtra_1.3.4 Matrix_1.4-1 ## [46] Rcpp_1.0.8.3 munsell_0.5.0 fansi_1.0.3 ## [49] gdtools_0.2.4 lifecycle_1.0.1 stringi_1.7.6 ## [52] ...
tbl_summary(table1_data, by = trt) %>% add_p()# 添加p值 按照默认的形式,p值是通过Wilcoxon rank sum test 和Pearson's Chi-squared test计算得出(见表格的注脚部分)。 关于tbl_summary()函数的详细内容,可以参考R自带的帮助系统(如何使用R语言自带的帮助功能?): 3. 制作logistic回归结果的表格 关于tb...
看看是否有更直接的方法会很有趣。对于表体,您可以使用tbl_custom_summary实现所需的结果。要在表头中...
The information in this section applies to all {gtsummary} objects. The {gtsummary} table has two important internal objects: When you print output from thetbl_summary()function into the R console or into an R markdown document, the.$table_bodydata frame is formatted using the instructions li...
corr… categor… Fold level Neit… 18 (7… 6 (5.… 12 (1… 4 Fold chisq.test.no.corr… categor… Fold level R on… 120 (… 64 (5… 56 (4… # ℹ 4 more variables: test_result<list>, statistic<dbl>, parameter<int>, # p.value<dbl> ...
因此,我试图通过自定义函数输入tbl_uvregression函数(gt_summary包的Y参数。其思想是在我的函数中创建多个tbl,并返回合并的不同表。 下面是我正在使用的代码示例: #Loading libraries + example dataset from questionr package library(haven) library(tidyverse) ...
2.1.6 Part 1 Section 12.3, Part Summary 2.1.7 Part 1 Section 12.3.2, Chartsheet Part 2.1.8 Part 1 Section 12.3.6, Custom XML Mappings Part 2.1.9 Part 1 Section 12.3.7, Dialogsheet Part 2.1.10 Part 1 Section 12.3.19, Single Cell Table Definitions Part 2.1.11 Part 1 S...
Function takes a survfit object as an argument, and provides a formatted summary table of the results Usage tbl_survfit(x, ...) ## S3 method for class 'list' tbl_survfit( x, times = NULL, probs = NULL, statistic = NULL, label = NULL, label_header = NULL, estimate_fun = NULL...