# Initiate start-up file
source(file.path(rprojroot::find_root("DESCRIPTION"), "inst/startup.R"))
knitr::opts_chunk$set(echo = TRUE)

library(dplyr)
library(pkglite)

Pack Proprietary R Analysis Package

Using pkglite to pack proprietary R package and saved into ectd/r0pkg.txt.

path$home %>%
  collate(file_ectd(), file_auto("inst")) %>%
  prune("R/zzz.R") %>%
  pack(output = "ectd/r0pkg.txt")

Prepare Submission Analysis Progam

Transfer Rmarkdown file to txt files and saved in ectd folder.

knitr::include_graphics("pdf/tlf-efficacy.pdf")
# Note to Reviewer 
# To rerun the code below, please refer ADRG appendix.
# After required package are installed. 
# The path variable needs to be defined by using example code below
#
# path = list(adam = "path/to/esub/analysis/adam/datasets")     # Modify path to the actual location
# path$output = "."                                             # Output saved in current folder
knitr::purl("tlf-demographic.Rmd", output = "ectd/tlf-demographic.r")
knitr::purl("tlf-efficacy.Rmd",    output = "ectd/tlf-efficacy.r")
knitr::purl("tlf-kmplot.Rmd", output = "ectd/tlf-kmplot.r")
knitr::purl("tlf-primary.Rmd", output = "ectd/tlf-primary.r")

List R package for analysis

pkg <- c("pkglite","haven", "dplyr", "tidyr", "emmeans", "r2rtf","rtables", 
         "ggplot2", "cowplot", "visR",
         "Tplyr", "pharmaRTF", "huxtable", "stringr")

available.packages(contriburl = contrib.url(repos)) %>% 
  data.frame() %>% 
  subset(Package %in% pkg) %>% 
  select(Package, Version, Repository) %>%
  arrange(Package)

Proprietary Package

tribble(~ Package, ~ Version, 
        "pilot1wrappers", "0.1.1")

Dry run

pkglite::unpack(input = "ectd/r0pkg.txt", output = tempdir(), install = TRUE)
list.files("ectd")


RConsortium/submissions-pilot1 documentation built on Feb. 25, 2024, 6:14 a.m.