From 04851a8faa075fae9c169738b7c9b6d832be48f1 Mon Sep 17 00:00:00 2001 From: Adrian Waddell Date: Thu, 16 Sep 2021 11:35:11 +0200 Subject: [PATCH 1/3] use newest version of `staged.dependencies` --- .github/workflows/build-check-install.yaml | 30 ++++++++++------------ 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-check-install.yaml b/.github/workflows/build-check-install.yaml index fb8eeefc2b..06120125a5 100644 --- a/.github/workflows/build-check-install.yaml +++ b/.github/workflows/build-check-install.yaml @@ -16,24 +16,19 @@ jobs: fail-fast: false matrix: config: - - {image: waddella/rocker_rstudio_4.1.0_deps, tag: 'latest'} - {image: ghcr.io/insightsengineering/rstudio_4.1.0_bioc_3.13, tag: 'latest'} steps: - -# TODO: add qpdf - - name: Check if Docker Image meets Requirements + - name: Check if Docker image meets requirements run: | lsb=$(lsb_release -d) [[ ! $lsb =~ "Ubuntu" ]] && exit 1 - for PKG in r-base curl git - do - dpkg -l $PKG - if [[ ! $? ]]; then - echo "System package $PGK is not available" - exit 1 - fi + required_pkgs="r-base curl git" + for PKG in $required_pkgs + do { + DPKG_PAGER=cat dpkg -l $PKG + } done shell: bash @@ -66,7 +61,6 @@ jobs: env: GITHUB_PAT: ${{ secrets.REPO_GITHUB_TOKEN }} # or ${{ secrets.GITHUB_TOKEN }} - - name: Checkout repo during PR uses: actions/checkout@v2 if: github.event_name == 'pull_request' @@ -106,7 +100,6 @@ jobs: } shell: Rscript {0} - - name: Install R package dependencies run: | setwd("${{ github.event.repository.name }}") @@ -121,11 +114,14 @@ jobs: if (file.exists("staged_dependencies.yaml")) { cat("\nInstall Staged Dependencies\n\n\n") - if (!require("staged.dependencies")) remotes::install_github("openpharma/staged.dependencies", ref = "main", Ncpus = ncores) + if (!require("staged.dependencies")) { + remotes::install_github("openpharma/staged.dependencies", ref = "v0.2", Ncpus = ncores, upgrade = "never") + } cat("\nCalculating Staged Dependency Table...\n\n") - print(staged.dependencies::dependency_table(), width = 120) + x <- staged.dependencies::dependency_table() + print(x, width = 120) cat("\n\n") - staged.dependencies::install_deps(install_project = FALSE, verbose = TRUE) + staged.dependencies::install_deps(dep_structure = x, install_project = FALSE, verbose = TRUE) } shell: Rscript {0} env: @@ -138,13 +134,13 @@ jobs: shell: bash # TODO: if configurable then --as-cran optionally -# TODO: TESTING_DEPTH - name: Run R CMD CHECK run: R CMD check --no-manual ${{ env.PKGBUILD }} shell: bash continue-on-error: true env: TESTING_DEPTH: 1 + _R_CHECK_TESTS_NLINES_: 0 - name: Catch warnings in R CMD check output id: catch-errors From d059d27cb1fbcfe23598db51a3a821a7aa746c1a Mon Sep 17 00:00:00 2001 From: Adrian Waddell Date: Thu, 16 Sep 2021 11:39:31 +0200 Subject: [PATCH 2/3] add magrittr as a dependency --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0f47c4abbf..65d2670df3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -23,7 +23,8 @@ Imports: rtables, assertthat, dplyr, - rlang + rlang, + magrittr Suggests: scda.2021, scda, From 2a2507bbed57e6de5db94c99640d1a0f8f8c4e72 Mon Sep 17 00:00:00 2001 From: Adrian Waddell Date: Thu, 16 Sep 2021 12:05:51 +0200 Subject: [PATCH 3/3] fix documentation --- DESCRIPTION | 2 +- R/dst01.R | 2 +- R/utils.R | 7 +++++++ man/dst01_1.Rd | 4 +--- man/dst01_2.Rd | 2 +- man/dst01_3.Rd | 2 +- man/var_labels_for.Rd | 16 ++++++++++++++++ 7 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 man/var_labels_for.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 65d2670df3..3efa6b94a1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -15,7 +15,7 @@ Roxygen: list(markdown = TRUE) License: file LICENSE Encoding: UTF-8 LazyData: true -RoxygenNote: 7.1.1 +RoxygenNote: 7.1.2 Depends: R (>= 4.0.0), tern diff --git a/R/dst01.R b/R/dst01.R index 2f59d6cfee..4895b66731 100644 --- a/R/dst01.R +++ b/R/dst01.R @@ -20,7 +20,7 @@ check_dst01_1_args <- function(reason, status, status_treatment) { #' study a reason is provided. #' #' @inheritParams gen_args -#' @param arm (`string`) variable. Usually one of `ARM`, `ACTARM`, `TRT01A`, or `TRT01A`. +#' @param armvar (`string`) variable. Usually one of `ARM`, `ACTARM`, `TRT01A`, or `TRT01A`. #' @param status (`string`) variable used to define patient status. Default is `EOSSTT`, however can also be a variable #' name with the pattern `EOPxxSTT` where `xx` must be substituted by 2 digits referring to the analysis period. #' @param reason (`string`) variable used to define reason for patient withdrawal. Default is `DCSREAS`, however can diff --git a/R/utils.R b/R/utils.R index 310509389a..a5597403a6 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,4 +1,11 @@ +# as we use NSE +globalVariables(c("ANL01FL", "adae", "ANL01FL")) +#' Retrieve Variables for Certain variables +#' +#' @param df data froma +#' @param vars variable names in data frame `df` +#' #' @importFrom assertthat assert_that #' @importFrom rtables var_labels #' @export diff --git a/man/dst01_1.Rd b/man/dst01_1.Rd index b049dc4fed..5b1cd5d728 100644 --- a/man/dst01_1.Rd +++ b/man/dst01_1.Rd @@ -21,7 +21,7 @@ dst01_1( \item{adae}{Adverse Events Analysis Dataset} -\item{armvar}{variable used for column splitting} +\item{armvar}{(\code{string}) variable. Usually one of \code{ARM}, \code{ACTARM}, \code{TRT01A}, or \code{TRT01A}.} \item{lbl_overall}{label used for overall column, if set to \code{NULL} the overall column is omitted} @@ -35,8 +35,6 @@ period.} \item{deco}{decoration list with \code{title}, \code{subtitles} and \code{main_footer} content} \item{.study}{a list with default values for the arguments of the function} - -\item{arm}{(\code{string}) variable. Usually one of \code{ARM}, \code{ACTARM}, \code{TRT01A}, or \code{TRT01A}.} } \description{ The DST01 Disposition Table provides an overview of patients study completion. For patients who discontinued the diff --git a/man/dst01_2.Rd b/man/dst01_2.Rd index fe00ef7504..8cd71942f0 100644 --- a/man/dst01_2.Rd +++ b/man/dst01_2.Rd @@ -21,7 +21,7 @@ dst01_2( \item{adae}{Adverse Events Analysis Dataset} -\item{armvar}{variable used for column splitting} +\item{armvar}{(\code{string}) variable. Usually one of \code{ARM}, \code{ACTARM}, \code{TRT01A}, or \code{TRT01A}.} \item{lbl_overall}{label used for overall column, if set to \code{NULL} the overall column is omitted} diff --git a/man/dst01_3.Rd b/man/dst01_3.Rd index 1df1907cb6..059ce3bfd6 100644 --- a/man/dst01_3.Rd +++ b/man/dst01_3.Rd @@ -22,7 +22,7 @@ dst01_3( \item{adae}{Adverse Events Analysis Dataset} -\item{armvar}{variable used for column splitting} +\item{armvar}{(\code{string}) variable. Usually one of \code{ARM}, \code{ACTARM}, \code{TRT01A}, or \code{TRT01A}.} \item{lbl_overall}{label used for overall column, if set to \code{NULL} the overall column is omitted} diff --git a/man/var_labels_for.Rd b/man/var_labels_for.Rd new file mode 100644 index 0000000000..734ec38d0e --- /dev/null +++ b/man/var_labels_for.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils.R +\name{var_labels_for} +\alias{var_labels_for} +\title{Retrieve Variables for Certain variables} +\usage{ +var_labels_for(df, vars) +} +\arguments{ +\item{df}{data froma} + +\item{vars}{variable names in data frame \code{df}} +} +\description{ +Retrieve Variables for Certain variables +}