Introduction to the inTextSummaryTable package
Author: Laure Cougnaud
Date: 2026-05-04

# Introduction to the `inTextSummaryTable` package

#### Laure Cougnaud

#### May 04, 2026

# 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

Extensive documentation on how to create your in-text table is available in the vignette: Creation of in-text tables.

# 3 Create standard set of tables

The creation of standard T(LF)ables is described in the vignette: Creation of standard in-text tables

# 4 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 check the vignette: Exporting of in-text tables.

# 5 Advanced use

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: Advanced use of in-text tables.

# 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, see the vignette: Customization of aesthetics of in-text tables.

# 7 Visualization

The summary statistics displayed in the table can also be visualized, see the vignette: Visualization of in-text table summaries.

# 8 Appendix

## 8.1 Session information

R version 4.6.0 (2026-04-24) Platform: x86_64-pc-linux-gnu Running under: Ubuntu 24.04.4 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] clinUtils_0.2.2 inTextSummaryTable_3.4.0 knitr_1.51

loaded via a namespace (and not attached): [1] sass_0.4.10 generics_0.1.4 tidyr_1.3.2 fontLiberation_0.1.0 xml2_1.5.2 stringi_1.8.7
[7] hms_1.1.4 digest_0.6.39 magrittr_2.0.5 evaluate_1.0.5 grid_4.6.0 RColorBrewer_1.1-3
[13] flextable_0.9.11 fastmap_1.2.0 plyr_1.8.9 jsonlite_2.0.0 ggrepel_0.9.8 zip_2.3.3
[19] purrr_1.2.2 viridisLite_0.4.3 crosstalk_1.2.2 scales_1.4.0 fontBitstreamVera_0.1.1 textshaping_1.0.5
[25] jquerylib_0.1.4 cli_3.6.6 rlang_1.2.0 fontquiver_0.2.1 cowplot_1.2.0 cachem_1.1.0
[31] yaml_2.3.12 otel_0.2.0 gdtools_0.5.0 officer_0.7.4 reshape2_1.4.5 uuid_1.2-2
[37] dplyr_1.2.1 ggplot2_4.0.3 DT_0.34.0 forcats_1.0.1 vctrs_0.7.3 R6_2.6.1
[43] lifecycle_1.0.5 stringr_1.6.0 htmlwidgets_1.6.4 ragg_1.5.2 pkgconfig_2.0.3 pillar_1.11.1
[49] bslib_0.10.0 gtable_0.3.6 data.table_1.18.2.1 glue_1.8.1 Rcpp_1.1.1-1.1 systemfonts_1.3.2
[55] haven_2.5.5 xfun_0.57 tibble_3.3.1 tidyselect_1.2.1 farver_2.1.2 htmltools_0.5.9
[61] rmarkdown_2.31 compiler_4.6.0 S7_0.2.2 askpass_1.2.1 openssl_2.4.0