December 2021
In this workshop, we have three parts:
All opinions expressed are those of the presenter and not Merck Sharp & Dohme Corp., a subsidiary of Merck & Co., Inc., Kenilworth, NJ, USA.
Some slides need to be scrolled down to see the full content.
The toolchain, process, and formats may be different in different organizations. We only provide a recommended way to address them.
In this workshop, we assume you have some R programming experience and clinical development knowledge.
tidyverse
, dplyr
, tidyr
, ggplot2
etc.adsl
, adae
etc.install.packages(c( "tidyverse", # Data manipulation "r2rtf", # TLF generation "pkglite" # eCTD submission ))
esubdemo
project.
esubdemo
is shared in RStudio Cloud (https://rstudio.cloud/)We share the same philosophy described in Section 1.1 of R Packages book and quote here.
The ICH E3: structure and content of clinical study reports provide guidance to assist sponsors in the development of a CSR.
In a CSR, most of TLFs are located in
Public available CDISC pilot study data located at CDISC Bitbucket repository.
The dataset structure follows the CDISC Analysis Data Model (ADaM).
Source data: https://github.com/elong0527/r4csr/tree/master/data-adam
tidyverse
: a collection of R packages to simplify the workflow to manipulate, visualize and analyze data in R.
r2rtf
: an R package to create production-ready tables and figures in RTF format.
In the pharmaceutical industry, RTF/Microsoft Word play a central role in preparing clinical study reports
Different organizations can have different table standards
E.g., Table layout, Font size, Border type, Footnote, Data source
r2rtf
is an R package to create production-ready tables and figures in RTF format.
r2rtf
is designed to:
%>%
);tidyverse
)Before creating an RTF table, we need to:
Figure out table layout.
Split the layout into small tasks in the form of a computer program.
Execute the program.
r2rtf
is designed to enable pipes (%>%
).
head(iris) %>% rtf_body() %>% # Step 1 Add table attributes rtf_encode() %>% # Step 2 Convert attributes to RTF encode write_rtf("minimal.rtf") # Step 3 Write to a .rtf file
r2rtf
package provides the flexibility to customize table appearance for
r2rtf
package also provides the flexibility to convert figures in RTF format.
r2rtf
only focus on table format. Data manipulation and analysis should be handled by other R packages. (e.g., tidyverse
)
r2rtf
provides simple “verb” functions that correspond to each component of a table, to help you translate data frame to tables in RTF file.
Functions | Purpose | Optional/required |
---|---|---|
rtf_page_header() | add page header | optional |
rtf_title() | add title | optional |
rtf_subline() | add subject line | optional |
rtf_colheader() | add column header | optional |
rtf_body() | add table body | required |
rtf_footnote() | add footnote | optional |
rtf_source() | add data source | optional |
rtf_page_footer() | add page footer | optional |
rtf_encode() | convert table into rtf code | required |
write_rtf() | write rtf code into .rtf file | required |