Introduction to the `inTextSummaryTable` package"

Introduction

    library(knitr)
    opts_chunk$set(
        echo = TRUE, results = 'markup', warning = FALSE, 
        # stop document execution if error (not the default)
        error = FALSE, 
        message = FALSE, cache = FALSE,
        fig.width = 8, fig.height = 7,
        fig.path = "./figures_vignette/",
        fig.align = 'center')
    options(width = 170)
    # instead of warn = 0 by default
    # include warnings when they occur in the document
    options(warn = 1)

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

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 htmldocument.

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

    library(inTextSummaryTable)
    library(pander)
    library(tools) # toTitleCase

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)
    # ... of ADaM datasets
    names(dataAll)
    # access a specific dataset
    head(dataAll$ADSL, 1)

    # check label of a subset of the variable(s)
    head(labelVars)
    # or for a specific variable:
    labelVars["USUBJID"]
    # or:
    getLabelVar(var = "USUBJID", labelVars = labelVars)

Create your tables

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

Table formatting/export

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

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

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

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")

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")

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")

Appendix

Session information

    pander(sessionInfo())


Try the inTextSummaryTable package in your browser

Any scripts or data that you put into this service are public.

inTextSummaryTable documentation built on Sept. 12, 2023, 5:06 p.m.