create demographics RTF table
demogRTF_table(data, settings)
data | demographics data frame with columns specified in settings object |
---|---|
settings | list with parameters specifying the column names for:
|
rtf doc object
settings <- list(treatment_col = "ARM", sex_col = "SEX", race_col = "RACE", age_col = "AGE") demogRTF_table(safetyData::sdtm_dm, settings)#> Warning: number of items to replace is not a multiple of replacement length#> $table #> Placebo\l Xanomelin Xanomelin Screen #> ine(N=86) e e Failure\l #> High Low ine(N=52) #> Dose\line Dose\line #> (N=84) (N=84) #> ────────────────────────────────────────────────────────────────────────────── #> Race AMERICAN 0 ( 0.0%) 1 ( 1.2%) 0 ( 0.0%) 1 ( 1.9%) #> INDIAN OR #> ALASKA #> NATIVE #> Race ASIAN 0 ( 0.0%) 0 ( 0.0%) 0 ( 0.0%) 2 ( 3.8%) #> Race BLACK OR 8 ( 9.3%) 9 ( 6 ( 7.1%) 6 ( #> AFRICAN 10.7%) 11.5%) #> AMERICAN #> Race WHITE 78 ( 74 ( 78 ( 43 ( #> 90.7%) 88.1%) 92.9%) 82.7%) #> Age (Years) n 86 84 84 52 #> Age (Years) Mean (SD) 75.2 ( 74.4 ( 75.7 ( 75.1 ( #> 8.59) 7.89) 8.29) 9.70) #> Age (Years) Median 76.0 76.0 77.5 76.0 #> Age (Years) Q1, Q3 69.2, 70.8, 71.0, 71.8, #> 81.8 80.0 82.0 81.2 #> Age (Years) Min, Max 52, 89 56, 88 51, 88 50, 89 #> Age (Years) Missing 0 0 0 0 #> #> Column names: row_label1, row_label2, var1_Placebo, var1_Xanomeline High Dose, #> var1_Xanomeline Low Dose, var1_Screen Failure, var1_Total #> #> 6/7 columns shown. #> $titles #> $titles[[1]] #> $text #> [1] "Protocol: XXX" "PAGE_FORMAT: Page %s of %s" #> #> attr(,"align") #> [1] "split" #> attr(,"bold") #> [1] TRUE #> attr(,"italic") #> [1] TRUE #> attr(,"font") #> [1] NA #> attr(,"font_size") #> [1] NA #> attr(,"index") #> [1] NA #> attr(,"class") #> [1] "hf_line" #> #> $titles[[2]] #> $text #> [1] "Table 14-2.01" #> #> attr(,"align") #> [1] "center" #> attr(,"bold") #> [1] TRUE #> attr(,"italic") #> [1] TRUE #> attr(,"font") #> [1] NA #> attr(,"font_size") #> [1] NA #> attr(,"index") #> [1] NA #> attr(,"class") #> [1] "hf_line" #> #> $titles[[3]] #> $text #> [1] "Summary of Demographic and Baseline Characteristics" #> #> attr(,"align") #> [1] "center" #> attr(,"bold") #> [1] TRUE #> attr(,"italic") #> [1] TRUE #> attr(,"font") #> [1] NA #> attr(,"font_size") #> [1] NA #> attr(,"index") #> [1] NA #> attr(,"class") #> [1] "hf_line" #> #> #> $footnotes #> $footnotes[[1]] #> $text #> [1] "FILE_PATH: Source: %s" "DATE_FORMAT: %H:%M %A, %B %d, %Y" #> #> attr(,"align") #> [1] "split" #> attr(,"bold") #> [1] FALSE #> attr(,"italic") #> [1] TRUE #> attr(,"font") #> [1] NA #> attr(,"font_size") #> [1] NA #> attr(,"index") #> [1] NA #> attr(,"class") #> [1] "hf_line" #> #> #> attr(,"margins") #> top bottom left right #> 1 1 1 1 #> attr(,"orientation") #> [1] "landscape" #> attr(,"header_height") #> [1] 0.5 #> attr(,"footer_height") #> [1] 0.5 #> attr(,"pagesize") #> width height #> 11.0 8.5 #> attr(,"font") #> [1] "Courier New" #> attr(,"font_size") #> [1] 10 #> attr(,"ignore_cell_padding") #> [1] TRUE #> attr(,"column_header_buffer") #> top bottom #> 1 0 #> attr(,"class") #> [1] "rtf_doc"