Last updated: 2024-12-03

Checks: 7 0

Knit directory: demor2/

This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20241122) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 5776387. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .DS_Store

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/table1.Rmd) and HTML (docs/table1.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
html 2af34c5 Chun-Hui Lin 2024-11-23 Build site.
html b8b756f Chun-Hui Lin 2024-11-23 Build site.
html b907743 Chun-Hui Lin 2024-11-23 Build site.
html f1269bb Chun-Hui Lin 2024-11-22 Build site.
html 5becf00 Chun-Hui Lin 2024-11-22 Build site.
Rmd f2cfa56 Chun-Hui Lin 2024-11-22 Add table1-related files.

Some notes on generating Table 1 from the tbl_summary() tutorial using trial dataset as the example.

Warning: package 'gtsummary' was built under R version 4.4.1
trial %>%
  tbl_summary(by = trt,
              label = age ~ 'Age at Screening',
              statistic = age ~ '{mean} ({sd})',
              digits = list(all_continuous() ~ c(1, 1),
                            all_categorical() ~ c(0, 1)),
              missing_text = '(Missing)') %>%
  add_p(test = age ~ 't.test', 
        pvalue_fun = ~ style_pvalue(.x, digits = 2)) %>% # add p-values
  add_overall() %>% # add column with overall summary statistics
  modify_header(label ~ "") %>% # remove default header text
  modify_caption("**Table 1. Patient characteristics**") %>% # modify table title
  bold_labels() %>% # bold labels
  bold_p() # bold p-values if significant
Table 1. Patient characteristics
Overall
N = 2001
Drug A
N = 981
Drug B
N = 1021
p-value2
Age at Screening 47.2 (14.3) 47.0 (14.7) 47.4 (14.0) 0.83
    (Missing) 11 7 4
Marker Level (ng/mL) 0.6 (0.2, 1.4) 0.8 (0.2, 1.6) 0.5 (0.2, 1.2) 0.085
    (Missing) 10 6 4
T Stage


0.87
    T1 53 (26.5%) 28 (28.6%) 25 (24.5%)
    T2 54 (27.0%) 25 (25.5%) 29 (28.4%)
    T3 43 (21.5%) 22 (22.4%) 21 (20.6%)
    T4 50 (25.0%) 23 (23.5%) 27 (26.5%)
Grade


0.87
    I 68 (34.0%) 35 (35.7%) 33 (32.4%)
    II 68 (34.0%) 32 (32.7%) 36 (35.3%)
    III 64 (32.0%) 31 (31.6%) 33 (32.4%)
Tumor Response 61 (31.6%) 28 (29.5%) 33 (33.7%) 0.53
    (Missing) 7 3 4
Patient Died 112 (56.0%) 52 (53.1%) 60 (58.8%) 0.41
Months to Death/Censor 22.4 (15.9, 24.0) 23.5 (17.4, 24.0) 21.2 (14.5, 24.0) 0.14
1 Mean (SD); Median (Q1, Q3); n (%)
2 Welch Two Sample t-test; Wilcoxon rank sum test; Pearson’s Chi-squared test

sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: aarch64-apple-darwin20
Running under: macOS 15.1.1

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Detroit
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] gtsummary_2.0.3 workflowr_1.7.1

loaded via a namespace (and not attached):
 [1] gt_0.10.1         sass_0.4.9        utf8_1.2.4        generics_0.1.3   
 [5] tidyr_1.3.1       xml2_1.3.6        stringi_1.8.4     digest_0.6.37    
 [9] magrittr_2.0.3    evaluate_1.0.0    cards_0.3.0       fastmap_1.2.0    
[13] rprojroot_2.0.4   jsonlite_1.8.9    processx_3.8.4    whisker_0.4.1    
[17] cardx_0.2.1       backports_1.5.0   ps_1.7.6          promises_1.3.0   
[21] httr_1.4.7        purrr_1.0.2       fansi_1.0.6       jquerylib_0.1.4  
[25] cli_3.6.3         rlang_1.1.4       commonmark_1.9.1  withr_3.0.1      
[29] cachem_1.1.0      yaml_2.3.10       tools_4.4.0       dplyr_1.1.4      
[33] httpuv_1.6.15     broom_1.0.7       vctrs_0.6.5       R6_2.5.1         
[37] lifecycle_1.0.4   git2r_0.33.0      stringr_1.5.1     fs_1.6.4         
[41] pkgconfig_2.0.3   callr_3.7.6       pillar_1.9.0      bslib_0.8.0      
[45] later_1.3.2       glue_1.8.0        Rcpp_1.0.13       xfun_0.47        
[49] tibble_3.2.1      tidyselect_1.2.1  rstudioapi_0.16.0 knitr_1.48       
[53] htmltools_0.5.8.1 rmarkdown_2.28    compiler_4.4.0    getPass_0.2-4    
[57] markdown_1.12