Skip to content

Commit

Permalink
Merge pull request #110 from RConsortium/59_report-tlf
Browse files Browse the repository at this point in the history
59 report tlf. closes #59
  • Loading branch information
laxamanaj authored Aug 25, 2023
2 parents 18fbbbc + a06ce8c commit 804dcae
Show file tree
Hide file tree
Showing 13 changed files with 82 additions and 15 deletions.
2 changes: 1 addition & 1 deletion submission/output/tlf-demographic-pilot3.out
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ MMSE Total
—————————————————————————————————————————————————————————————————————————————————————————————————

Program: tlf_demographic.R
2023-08-11 17:14:16
2023-08-17 18:25:20

2 changes: 1 addition & 1 deletion submission/output/tlf-efficacy-pilot3.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
\clbrdrl\brdrs\brdrw15\clbrdrt\brdrs\brdrw15\clbrdrr\brdrs\brdrw15\clbrdrb\brdrdb\brdrw15\clvertalt\cellx9000
\pard\hyphpar0\sb15\sa15\fi0\li0\ri0\ql\fs18{\f0 Root Mean Squared Error of Change = 1.30}\cell
\intbl\row\pard
{\pard\hyphpar\sb15\sa15\fi0\li0\ri0\qc\fs18{\f0 Table generated on: 2023-08-11 17:24:01}\par}
{\pard\hyphpar\sb15\sa15\fi0\li0\ri0\qc\fs18{\f0 Table generated on: 2023-08-17 18:22:20}\par}
{\pard\hyphpar\sb15\sa15\fi0\li0\ri0\qc\fs18{\f0 Source: [pilot3: adam-adsl; adlbc]}\par}


Expand Down
Binary file modified submission/output/tlf-kmplot-pilot3.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions submission/output/tlf-primary-pilot3.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
\par\ql
{\f1\fs20\i [3] Pairwise comparison with treatment as a categorical variable: p-values without adjustment for multiple comparisons.}
\par\ql\tx7245\tqr\tx12960
{\f1\fs20\i Source: <run interactively>}\pmartabqr
{\f1\fs20\i 17:15 Friday, August 11, 2023}\par
{\f1\fs20\i }\pmartabqr
{\f1\fs20\i 15:34 Thursday, August 17, 2023}\par
}
{
\trowd
Expand Down
73 changes: 73 additions & 0 deletions submission/programs/report-tlf-pilot3.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: "R Consortium R Submission Pilot 3 - Summary Tables and Figures"
author: "Pilot 3 Team"
date: "`r Sys.Date()`"
output:
pdf_document:
latex_engine: pdflatex
header-includes:
- \usepackage{pdfpages}
---

Note : In Pilot 3, following the same approach as Pilot1, different open-source packages were used when generating each of the 4 analysis outputs to test wider use case scenarios. The outputs were formatted differently intentionally to cover different company specific formatting choices.

\newpage

```{r path, echo=FALSE}
path <- list(
sdtm = "./submission/sdtm", # Modify path to the sdtm location
adam = "./submission/adam", # Modify path to the adam location
output = "./submission/output" # Modify path to the output location
)
```

#### Table 14-2.01
#### Summary of Demographic and Baseline Characteristics

```{r demog, out.width = "40%", out.height = "400px", echo=FALSE, message=FALSE, comment=NA}
setwd("/cloud/project")
source("/cloud/project/submission/programs/tlf-demographic.r")
print(tbl)
```

\newpage

#### Table 14-3.01
#### Primary Endpoint Analysis: ADAS Cog (11) - Change from Baseline to Week 24 - LOCF

```{r primary, echo=FALSE, message=FALSE, comment=NA}
# setwd("/cloud/project")
# source("/cloud/project/submission/programs/tlf-primary.r")
```

\hfill\break\hfill\break\hfill\break\includegraphics[page=1]{/cloud/project/submission/output/tlf-primary-pilot3.rtf.pdf}
\
\
\hfill\break\hfill\break\hfill\break\includegraphics[page=2]{/cloud/project/submission/output/tlf-primary-pilot3.rtf.pdf}

\newpage

#### Table 14-3.02
#### Primary Endpoint Analysis: Glucose (mmol/L) - Summary at Week 20 - LOCF

```{r efficacy, echo=FALSE, message=FALSE, comment=NA}
# setwd("/cloud/project")
# source("/cloud/project/submission/programs/tlf-efficacy.r")
# print(tbl)
```

\includegraphics[page=1]{/cloud/project/submission/output/tlf-efficacy-pilot3.rtf.pdf}

\newpage

#### Figure 14-1
#### Time to Dermatologic Event by Treatment Group
\
\
```{r plot, echo=FALSE, message=FALSE, comment=NA, fig.align="center",out.width="100%"}
setwd("/cloud/project")
source("/cloud/project/submission/programs/tlf-kmplot.r")
print(km)
```


Binary file added submission/programs/report-tlf-pilot3.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion submission/programs/tlf-demographic.r
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ vars <- c("AGE", "AGEGR1", "RACE", "HEIGHTBL", "WEIGHTBL", "BMIBL", "MMSETOT")
lyt <- basic_table(
title = "Protocol: CDISCPILOT01",
subtitles = "Population: Intent-to-Treat",
main_footer = paste0("Program: tlf_demographic.R \n", Sys.time())
main_footer = paste0("Program: tlf-demographic.r \n", Sys.time())
) %>%
split_cols_by("TRT01P") %>%
add_colcounts() %>%
Expand Down
4 changes: 2 additions & 2 deletions submission/programs/tlf-kmplot.r
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ km <- km +
ggplot2::geom_hline(yintercept = 0.5, linetype = "dashed")

km <- km %>%
visR::add_risktable(group = "statlist")
visR::add_risktable(group = "statlist", rowgutter = 0.25)

title <- cowplot::ggdraw() +
cowplot::draw_label(
Expand All @@ -90,7 +90,7 @@ title <- cowplot::ggdraw() +

caption <- cowplot::ggdraw() +
cowplot::draw_label(
paste0("\nProgram: tlf_kmplot.R [", Sys.time(), "]"),
paste0("\nProgram: tlf-kmplot.r [", Sys.time(), "]"),
fontfamily = "sans",
size = 10
)
Expand Down
2 changes: 1 addition & 1 deletion vignettes/adrg.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ output:
---


![Cover Letter](pdf/adrg.pdf){width=700px height=1100px}
![Cover Letter](pdf/adrg.pdf){width=700px height=1100px}
2 changes: 1 addition & 1 deletion vignettes/cover-letter.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ output:
---


![Cover Letter](pdf/cover-letter.pdf){width=700px height=1100px}
![Cover Letter](pdf/cover-letter.pdf){width=700px height=1100px}
3 changes: 0 additions & 3 deletions vignettes/tlf-efficacy.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@ tbl_3 <- apr0ancova3 %>%

```{r, message = FALSE, echo = FALSE}
tbl <- list(tbl_1, tbl_2, tbl_3)
# tbl %>%
# rtf_encode() %>%
# write_rtf(file.path(path$output, "tlf-efficacy.rtf"))
```

```{r, out.width = "100%", out.height = "400px", echo = FALSE, fig.align = "center"}
Expand Down
2 changes: 0 additions & 2 deletions vignettes/tlf-kmplot.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ ggplot2::theme_set(theme_bw())
pdf.options(reset = TRUE, onefile = FALSE)
# pdf(file.path(path$output, "tlf-kmplot.pdf"))
km <- visR::visr(surv_mod,
y_label = "Probability of event\n",
x_label = "Time to First Dermatologic Event (Days)",
Expand Down
1 change: 0 additions & 1 deletion vignettes/tlf-primary.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ doc <- rtf_doc(ht) %>%
)
# Write out the RTF
# write_rtf(doc, file = file.path(path$output, "tlf-primary.rtf"))
```

```{r, out.width = "100%", out.height = "400px", echo = FALSE, fig.align = "center"}
Expand Down

0 comments on commit 804dcae

Please sign in to comment.