Introduction to the inTextSummaryTable package
Author: Laure Cougnaud
Date: 2025-09-24

# Introduction to the `inTextSummaryTable` package

#### Laure Cougnaud

#### September 24, 2025

# 1 Introduction

The package `inTextSummaryTable` contains functionalities to create complex table of summary statistics or counts of variables of interest.

This table can be formatted to static

- in-text table for a Clinical Study Report,
- a topline presentation
- an interactive table, e.g. to be used inside the medical monitoring report.

These tables can be included into a `rmarkdown` document which can be converted into `html`, `docx` and `pptx`. Each table can be separately exported into a `text`, `docx` or `html`document.

We start the guidance to the functionalities of the `inTextSummaryTable`, via loading the following packages.

        library(inTextSummaryTable)
        library(tools) # toTitleCase

## 1.1 Data format

The input data for the creation of summary table should be a data.frame, usually loaded from a SAS data file (`sas7bdat` format). The label of the variables stored in the `SAS` datasets is also used for the title or the caption.

Note that the `loadDataADaMSDTM` function of the `clinUtils` package can be used to import your study-specific dataset(s) of interest into R.

For this vignette, ADaM datasets included in the `clinUtils` package are used.

        library(clinUtils)

        # load example data
        data(dataADaMCDISCP01)

        dataAll <- dataADaMCDISCP01
        labelVars <- attr(dataAll, "labelVars")

        # dataAll contains a list
        class(dataAll)

    ## [1] "list"

        # ... of ADaM datasets
        names(dataAll)

    ## [1] "ADAE"     "ADCM"     "ADLBC"    "ADPP"     "ADQSADAS" "ADQSCIBC" "ADQSNPIX" "ADSL"     "ADVS"

        # access a specific dataset
        head(dataAll$ADSL, 1)

    ##        STUDYID     USUBJID SUBJID SITEID SITEGR1                  ARM               TRT01P TRT01PN               TRT01A TRT01AN     TRTSDT     TRTEDT TRTDUR AVGDD
    ## 1 CDISCPILOT01 01-701-1148   1148    701     701 Xanomeline High Dose Xanomeline High Dose      81 Xanomeline High Dose      81 2013-08-23 2014-02-20    182  77.1
    ##   CUMDOSE AGE AGEGR1 AGEGR1N  AGEU  RACE RACEN SEX                 ETHNIC SAFFL ITTFL EFFFL COMP8FL COMP16FL COMP24FL DISCONFL DSRAEFL DTHFL BMIBL BMIBLGR1 HEIGHTBL
    ## 1   14040  57    <65       1 YEARS WHITE     1   M NOT HISPANIC OR LATINO     Y     Y     Y       Y        Y        Y                         28.3   25-<30    175.3
    ##   WEIGHTBL EDUCLVL   DISONSDT DURDIS DURDSGR1   VISIT1DT    RFSTDTC    RFENDTC VISNUMEN     RFENDT   DCDECOD  DCREASCD MMSETOT DATASET
    ## 1     87.1      15 2010-12-12   32.1     >=12 2013-08-14 2013-08-23 2014-02-20       12 2014-02-20 COMPLETED Completed      21    ADSL

        # check label of a subset of the variable(s)
        head(labelVars)

    ##                     STUDYID                      SITEID                     USUBJID                        TRTA                       TRTAN                         AGE
    ##          "Study Identifier"     "Study Site Identifier" "Unique Subject Identifier"          "Actual Treatment"      "Actual Treatment (N)"                       "Age"

        # or for a specific variable:
        labelVars["USUBJID"]

    ##                     USUBJID
    ## "Unique Subject Identifier"

        # or:
        getLabelVar(var = "USUBJID", labelVars = labelVars)

    ##                     USUBJID
    ## "Unique Subject Identifier"

# 2 Create your tables

A dedicated vignette on how to create your in-text table is available here).

# 3 Table formatting/export

If you are familiar with the creation of the tables, but you are wondering how to:

- export tables for specific formats as Word/PowerPoint/Html/R object
- save tables into separated documents
- set specific text formatting (e.g. superscripts/subscripts)
- filter and split exported tables

then the the dedicated vignette is available here), or accessible with

    vignette("inTextSummaryTable-exportTables", "inTextSummaryTable")

# 4 Advanced users

If you are familiar with the creation and export of the tables, and you want to know more on the functionalities less exposed to the users, you can check out the vignette for advanced users, which is available here) and with

    vignette("inTextSummaryTable-advanced", "inTextSummaryTable")

# 5 Visualization

The `inTextSummaryTable` has also visualization functionalities based on the computation of summary statistics. The vignette for visualization is available at this) link or through

    vignette("inTextSummaryTable-visualization", "inTextSummaryTable")

# 6 Aesthetics

The `inTextSummaryTable` package allow the user to set global options for the color schemes of tables and visualization. The main advantage is that if you wish to change the default palettes, it is possible to set your preferences only once at the beginning of the R script or Rmd document.

The vignette is available via this) link or

    vignette("inTextSummaryTable-aesthetics", "inTextSummaryTable")

# 7 Appendix

## 7.1 Session information

R version 4.5.1 (2025-06-13) Platform: x86_64-pc-linux-gnu Running under: Ubuntu 24.04.2 LTS

Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=C LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

time zone: Etc/UTC tzcode source: system (glibc)

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

other attached packages: [1] plyr_1.8.9 clinUtils_0.2.0 inTextSummaryTable_3.3.5 knitr_1.50

loaded via a namespace (and not attached): [1] sass_0.4.10 fontLiberation_0.1.0 xml2_1.4.0 stringi_1.8.7 hms_1.1.3 digest_0.6.37
[7] magrittr_2.0.3 evaluate_1.0.5 grid_4.5.1 RColorBrewer_1.1-3 flextable_0.9.10 fastmap_1.2.0
[13] jsonlite_2.0.0 ggrepel_0.9.6 zip_2.3.3 crosstalk_1.2.2 viridisLite_0.4.2 scales_1.4.0
[19] fontBitstreamVera_0.1.1 textshaping_1.0.1 jquerylib_0.1.4 cli_3.6.5 rlang_1.1.6 fontquiver_0.2.1
[25] cowplot_1.2.0 withr_3.0.2 cachem_1.1.0 yaml_2.3.10 gdtools_0.4.3 officer_0.6.10
[31] reshape2_1.4.4 uuid_1.2-1 ggplot2_4.0.0 DT_0.33 forcats_1.0.0 vctrs_0.6.5
[37] R6_2.6.1 lifecycle_1.0.4 stringr_1.5.1 htmlwidgets_1.6.4 ragg_1.4.0 pkgconfig_2.0.3
[43] bslib_0.9.0 pillar_1.11.0 gtable_0.3.6 data.table_1.17.8 glue_1.8.0 Rcpp_1.1.0
[49] systemfonts_1.2.3 haven_2.5.5 xfun_0.53 tibble_3.3.0 farver_2.1.2 htmltools_0.5.8.1
[55] labeling_0.4.3 rmarkdown_2.29 compiler_4.5.1 S7_0.2.0 askpass_1.2.1 openssl_2.3.3