Skip to content

Commit

Permalink
Merge branch 'main' into 413_qtcat@main
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkliming committed Jul 11, 2023
2 parents b4ab7d8 + 65724ad commit 16f4330
Show file tree
Hide file tree
Showing 217 changed files with 6,453 additions and 1,972 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ For new feature requests, please elaborate on the context and the benefit the fe

## Pull requests

### Github Flow
### GitHub Flow

This repository uses the [Github Flow](https://docs.github.com/en/get-started/quickstart/github-flow) model for collaboration. To submit a pull request:
This repository uses the [GitHub Flow](https://docs.github.com/en/get-started/quickstart/github-flow) model for collaboration. To submit a pull request:

1. Create a branch

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
additional-r-cmd-check-params: --as-cran
enforce-note-blocklist: true
note-blocklist: |
checking dependencies in R code ... NOTE
checking R code for possible problems ... NOTE
checking examples ... NOTE
checking Rd line widths ... NOTE
checking dependencies in R code .* NOTE
checking R code for possible problems .* NOTE
checking examples .* NOTE
checking Rd line widths .* NOTE
unit-test-report-brand: >-
https://raw.githubusercontent.com/insightsengineering/hex-stickers/main/thumbs/chevron.png
coverage:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main
paths:
- inst/templates/**
- _pkgdown.yml
- _pkgdown.*
- DESCRIPTION
- '**.md'
- man/**
Expand All @@ -23,7 +23,7 @@ on:
- main
paths:
- inst/templates/**
- _pkgdown.yml
- _pkgdown.*
- DESCRIPTION
- '**.md'
- man/**
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/post-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Post release ✨

on:
release:
types: ["released"]

jobs:
vbump:
name: Version Bump 🤜🤛
uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
with:
vbump-after-release: true
12 changes: 6 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
release:
name: Create release 🎉
uses: insightsengineering/r.pkg.template/.github/workflows/release.yaml@main
permissions:
contents: write
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
r-cmd:
name: R CMD Check 🧬
needs: [release, docs]
Expand All @@ -48,10 +48,10 @@ jobs:
additional-r-cmd-check-params: --as-cran
enforce-note-blocklist: true
note-blocklist: |
checking dependencies in R code ... NOTE
checking R code for possible problems ... NOTE
checking examples ... NOTE
checking Rd line widths ... NOTE
checking dependencies in R code .* NOTE
checking R code for possible problems .* NOTE
checking examples .* NOTE
checking Rd line widths .* NOTE
unit-test-report-brand: >-
https://raw.githubusercontent.com/insightsengineering/hex-stickers/main/thumbs/chevron.png
coverage:
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ repos:
- id: roxygenize
name: Regenerate package documentation
additional_dependencies:
- purrr
- vctrs
- checkmate
- dplyr
- insightsengineering/dunlin
Expand Down
22 changes: 13 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
Type: Package
Package: chevron
Title: Standard TLGs for Clinical Trials Reporting
Version: 0.2.0.9004
Date: 2023-06-08
Version: 0.2.0.9024
Date: 2023-07-10
Authors@R: c(
person("Benoit", "Falquet", , "benoit.falquet@roche.com", role = c("aut", "cre")),
person("Liming", "Li", , "liming.li@roche.com", role = "aut"),
person("Adrian", "Waddell", , "adrian.waddell@gene.com", role = "aut"),
person("Emily", "de la Rua", , "emily.de_la_rua@contractors.roche.com", role = "aut"),
person("Joe", "Zhu", , "joe.zhu@roche.com", role = "aut"),
person("Tim", "Barnett", , "timothy.barnett@roche.com", role = "aut"),
person("Lena", "Wang", , "wang.xinyue@gene.com", role = "aut"),
person("Heng", "Wang", , "wang.heng@gene.com", role = "aut"),
person("Xiaoli", "Duan", , "xiaoli.duan@roche.com", role = "aut"),
person("Tim", "Barnett", , "timothy.barnett@roche.com", role = "ctb"),
person("Tian", "Fang", , "tian.fang@roche.com", role = "ctb"),
person("F. Hoffmann-La Roche AG", role = c("cph", "fnd"))
)
Description: Standard Table, Listings, and Graphs (TLG) library used in
Expand All @@ -35,7 +32,7 @@ Imports:
rlistings (>= 0.2.2),
rtables (>= 0.6.1),
stringr,
tern (>= 0.8.2),
tern (>= 0.8.4),
tibble,
utils
Suggests:
Expand All @@ -55,6 +52,7 @@ Remotes:
Config/Needs/website: insightsengineering/nesttemplate
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Expand All @@ -67,13 +65,16 @@ Collate:
'aet02.R'
'aet03.R'
'aet04.R'
'aet05.R'
'aet05_all.R'
'aet10.R'
'assertions.R'
'cfbt01.R'
'checks.R'
'chevron_tlg-S4methods.R'
'cmt01a.R'
'cmt02_pt.R'
'coxt01.R'
'coxt02.R'
'data.R'
'dmt01.R'
Expand All @@ -100,6 +101,9 @@ Collate:
'pdt02.R'
'reexports.R'
'rmpt01.R'
'rmpt03.R'
'rmpt04.R'
'rmpt05.R'
'rspt01.R'
'rtables_utils.R'
'standard_rules.R'
Expand Down
26 changes: 20 additions & 6 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ S3method(empty_as_na,factor)
S3method(lvls,character)
S3method(lvls,default)
S3method(lvls,factor)
export("datasets<-")
export("main<-")
export("postprocess<-")
export("preprocess<-")
Expand All @@ -38,6 +37,12 @@ export(aet04)
export(aet04_main)
export(aet04_post)
export(aet04_pre)
export(aet05)
export(aet05_all)
export(aet05_all_pre)
export(aet05_main)
export(aet05_post)
export(aet05_pre)
export(aet10)
export(aet10_main)
export(aet10_post)
Expand All @@ -62,11 +67,12 @@ export(cmt02_pt)
export(cmt02_pt_main)
export(cmt02_pt_post)
export(cmt02_pt_pre)
export(coxt01)
export(coxt01_main)
export(coxt01_post)
export(coxt01_pre)
export(coxt02)
export(coxt02_main)
export(coxt02_post)
export(coxt02_pre)
export(datasets)
export(dmt01)
export(dmt01_main)
export(dmt01_post)
Expand Down Expand Up @@ -166,6 +172,15 @@ export(rmpt01)
export(rmpt01_main)
export(rmpt01_post)
export(rmpt01_pre)
export(rmpt03)
export(rmpt03_main)
export(rmpt03_pre)
export(rmpt04)
export(rmpt04_main)
export(rmpt04_pre)
export(rmpt05)
export(rmpt05_main)
export(rmpt05_pre)
export(rspt01)
export(rspt01_main)
export(rspt01_post)
Expand All @@ -192,12 +207,10 @@ exportClasses(chevron_g)
exportClasses(chevron_l)
exportClasses(chevron_t)
exportClasses(chevron_tlg)
exportMethods("datasets<-")
exportMethods("main<-")
exportMethods("postprocess<-")
exportMethods("preprocess<-")
exportMethods(args_ls)
exportMethods(datasets)
exportMethods(main)
exportMethods(postprocess)
exportMethods(preprocess)
Expand All @@ -210,6 +223,7 @@ import(rtables)
import(tern)
importFrom(checkmate,check_class)
importFrom(dunlin,reformat)
importFrom(dunlin,render_safe)
importFrom(dunlin,rule)
importFrom(forcats,fct_relevel)
importFrom(formatters,with_label)
Expand Down
10 changes: 8 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# chevron 0.2.0.9004
# chevron 0.2.0.9024

* Add `row_split_var` and `page_var` as argument for some template.
* Update `LBT06` template to use `PARAM` as row split.
* Convert `AVISIT` to factor according to `AVISITN` as order in preprocessing.
* Add `CFBT01` template. `VST01`, `EGT01` and `LBT01` are now all following `CFBT01`. By default parameters are by page displayed.
* Add `RMPT04` and `RMPT05` which follow `RMPT01`.
* Add `RMPT03` template.
* Update `EGT03` to use `ACTARMCD` as default arm variable, and remove the preprocessing of filtering to "HR".
* Update `EXT01` to allow it to be displayed by `PARCAT2`.
* Add `COXT01` template. `COXT02` is based on `COXT01` now.
* Add `AET05` and `AET05_ALL` template.

# chevron 0.2.0

Expand All @@ -12,7 +18,7 @@
* Remove deprecated `getter` functions `get_main`, `get_preprocess` and `get_postprocess`.
* Simplify `pre` function and add more data checks in `main` function.
* Remove redundant assertion functions.
* Add more templates: `AET10`, `KMG01`, `RSPT01`, `RMPT01`, `COXT02`, `FSTG01`, `LBT06`.
* Add more templates: `AET10`, `KMG01`, `RSPT01`, `RMPT01`, `COXT02`, `FSTG01`, and `LBT06`.

# chevron 0.1.4

Expand Down
11 changes: 6 additions & 5 deletions R/aet01.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ aet01_main <- function(adam_db,
"RELSER", "WD", "DSM", "REL", "RELWD", "RELDSM", "SEV"
)
),
anl_lbls = "Total number of patients with at least one",
anl_lbls = "Total number of {patient_label} with at least one",
...) {
assert_all_tablenames(adam_db, "adsl", "adae")
checkmate::assert_string(arm_var)
checkmate::assert_list(anl_vars, types = "character", names = "unique")
checkmate::assert_character(anl_lbls, min.chars = 1L)
lbl_overall <- render_safe(lbl_overall)
checkmate::assert_string(lbl_overall, null.ok = TRUE)
assert_valid_variable(adam_db$adsl, c("USUBJID", arm_var), types = list(c("character", "factor")))
assert_valid_variable(adam_db$adsl, c("DTHFL", "DCSREAS"), types = list(c("character", "factor")), min_chars = 0L)
Expand All @@ -42,6 +43,7 @@ aet01_main <- function(adam_db,
var_labels_for,
df = adam_db$adae
)
anl_lbls <- render_safe(anl_lbls)
if (length(anl_lbls) == 1) {
anl_lbls <- rep(anl_lbls, length(anl_vars))
}
Expand Down Expand Up @@ -81,7 +83,7 @@ aet01_lyt <- function(arm_var,
vars = "USUBJID",
.stats = c("unique", "nonunique"),
.labels = c(
unique = "Total number of patients with at least one AE",
unique = render_safe("Total number of {patient_label} with at least one AE"),
nonunique = "Total number of AEs"
),
.formats = list(unique = format_count_fraction_fixed_dp, nonunique = "xx"),
Expand All @@ -99,7 +101,7 @@ aet01_lyt <- function(arm_var,
"USUBJID",
filters = c("DCSREAS" = "ADVERSE EVENT"),
denom = "N_col",
.labels = c(count_fraction = "Total number of patients withdrawn from study due to an AE"),
.labels = c(count_fraction = render_safe("Total number of {patient_label} withdrawn from study due to an AE")),
table_names = "TotWithdrawal"
)

Expand Down Expand Up @@ -168,6 +170,5 @@ aet01_post <- function(tlg, prune_0 = FALSE, ...) {
aet01 <- chevron_t(
main = aet01_main,
preprocess = aet01_pre,
postprocess = aet01_post,
adam_datasets = c("adsl", "adae")
postprocess = aet01_post
)
Loading

0 comments on commit 16f4330

Please sign in to comment.