Skip to content

Commit

Permalink
Merge pull request #258 from metrumresearchgroup/release/0.4.1
Browse files Browse the repository at this point in the history
Release/0.4.1
  • Loading branch information
kylebaron authored Mar 17, 2022
2 parents 51fb699 + 385c035 commit cb6ae78
Show file tree
Hide file tree
Showing 33 changed files with 475 additions and 270 deletions.
171 changes: 28 additions & 143 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,7 @@
---
kind: pipeline
type: docker
name: mpn:latest

platform:
os: linux
arch: amd64

steps:
- name: pull
image: omerxx/drone-ecr-auth
commands:
- $(aws ecr get-login --no-include-email --region us-east-1)
- docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.0:latest
- docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-3.6:latest
volumes:
- name: docker.sock
path: /var/run/docker.sock

- name: "Check package: R 4.0"
pull: never
image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.0:latest
commands:
- R -s -e 'devtools::install_deps(upgrade = '"'"'never'"'"')'
- R -s -e 'devtools::check(env_vars = c("NOT_CRAN" = "true"))'


- name: "Check package: R 3.6"
pull: never
image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-3.6:latest
commands:
- R -s -e 'devtools::install_deps(upgrade = '"'"'never'"'"')'
- R -s -e 'devtools::check(env_vars = c("NOT_CRAN" = "true"))'

volumes:
- name: docker.sock
host:
path: /var/run/docker.sock

trigger:
event:
exclude:
- promote

---
kind: pipeline
type: docker
name: mpn:oldest
name: cran-latest

platform:
os: linux
Expand All @@ -55,114 +10,50 @@ platform:
steps:
- name: pull
image: omerxx/drone-ecr-auth
commands:
commands:
- $(aws ecr get-login --no-include-email --region us-east-1)
- docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.0:2020-06-08
- docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-3.6:2020-06-08
- docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-3.6:cran-latest
- docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.0:cran-latest
- docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:cran-latest
volumes:
- name: docker.sock
path: /var/run/docker.sock

- name: "Check package: R 4.0"
pull: never
image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.0:2020-06-08
commands:
- R -s -e 'devtools::install_deps(upgrade = '"'"'never'"'"')'
- R -s -e 'devtools::check(env_vars = c("NOT_CRAN" = "true"))'

- name: "Check package: R 3.6"
pull: never
image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-3.6:2020-06-08
image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-3.6:cran-latest
commands:
- R -s -e 'devtools::install_deps(upgrade = '"'"'never'"'"')'
- R -s -e 'devtools::install_deps(upgrade = '"'"'always'"'"', dependencies=TRUE)'
- R -s -e 'devtools::check(env_vars = c("NOT_CRAN" = "true"))'

volumes:
- name: docker.sock
host:
path: /var/run/docker.sock

trigger:
event:
exclude:
- promote

---
kind: pipeline
type: docker
name: cran-latest

platform:
os: linux
arch: amd64

steps:
- name: pull
image: omerxx/drone-ecr-auth
commands:
- $(aws ecr get-login --no-include-email --region us-east-1)
- docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.0:cran-latest
- docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-3.6:cran-latest
environment:
USER: drone
volumes:
- name: docker.sock
path: /var/run/docker.sock
- name: cache
path: /ephemeral

- name: "Check package: R 4.0"
pull: never
image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.0:cran-latest
commands:
- R -s -e 'devtools::install_deps(upgrade = '"'"'always'"'"')'
- R -s -e 'devtools::load_all(); sessioninfo::session_info()'
- R -s -e 'devtools::check(env_vars = c("NOT_CRAN" = "true"))'

- name: "Check package: R 3.6"
pull: never
image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-3.6:cran-latest
commands:
- R -s -e 'devtools::install_deps(upgrade = '"'"'always'"'"')'
- R -s -e 'devtools::load_all(); sessioninfo::session_info()'
- R -s -e 'devtools::install_deps(upgrade = '"'"'always'"'"', dependencies=TRUE)'
- R -s -e 'devtools::check(env_vars = c("NOT_CRAN" = "true"))'

volumes:
- name: docker.sock
host:
path: /var/run/docker.sock

trigger:
event:
exclude:
- promote

---
kind: pipeline
type: docker
name: coverage

platform:
os: linux
arch: amd64

steps:
- name: pull
image: omerxx/drone-ecr-auth
commands:
- $(aws ecr get-login --no-include-email --region us-east-1)
- docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.0:latest
environment:
USER: drone
volumes:
- name: docker.sock
path: /var/run/docker.sock

- name: cache
path: /ephemeral

- name: Code coverage
- name: "Check package: R 4.1"
pull: never
image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.0:latest
image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:cran-latest
commands:
- R -s -e 'devtools::install_deps(upgrade = '"'"'never'"'"')'
- R -s -e 'covr::codecov()'
- R -s -e 'devtools::install_deps(upgrade = '"'"'always'"'"', dependencies=TRUE)'
- R -s -e 'devtools::check(env_vars = c("NOT_CRAN" = "true"))'
environment:
CODECOV_TOKEN:
from_secret: CODECOV_TOKEN
NOT_CRAN: true
USER: drone
volumes:
- name: cache
path: /ephemeral

volumes:
- name: docker.sock
Expand All @@ -176,13 +67,10 @@ trigger:
exclude:
- promote

depends_on:
- mpn:latest
- cran-latest
---
kind: pipeline
type: docker
name: release
name: pmtables-release

platform:
os: linux
Expand All @@ -193,21 +81,20 @@ steps:
image: omerxx/drone-ecr-auth
commands:
- $(aws ecr get-login --no-include-email --region us-east-1)
- docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.0:latest
- docker pull 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:latest
volumes:
- name: docker.sock
path: /var/run/docker.sock

- name: Build package
pull: never
image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.0:latest
image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:latest
commands:
- git config --global user.email drone@metrumrg.com
- git config --global user.name Drony
- git fetch --tags
- R -s -e 'devtools::install_deps(upgrade = '"'"'always'"'"', dependencies=TRUE)'
- R -s -e 'pkgpub::create_tagged_repo(.dir = '"'"'/ephemeral'"'"')'
environment:
NOT_CRAN: true
volumes:
- name: cache
path: /ephemeral
Expand Down Expand Up @@ -248,6 +135,4 @@ trigger:
- tag

depends_on:
- mpn:latest
- mpn:oldest
- cran-latest
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: pmtables
Type: Package
Title: Tables for Pharmacometrics
Version: 0.4.0
Version: 0.4.1
Authors@R:
c(
person(given = "Kyle",
Expand Down Expand Up @@ -36,7 +36,7 @@ Suggests: testthat, yaml, fs, texPreview
Encoding: UTF-8
Language: en-US
LazyData: true
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
Roxygen: list(markdown = TRUE)
VignetteBuilder: knitr
Collate:
Expand Down
18 changes: 17 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# pmtables 0.4.1

- `colgroup()` (and `st_span()`) gains an `align` argument to position
the spanner title on left or right in addition to the center (default)
#260, #261.

- `rowpanel()` (and `st_panel()`) gains `jut`argument to push non-panel
table contents to the right relative to the panel header row so that
contents under the panel header are indented #251, #253.

- Panel header rows are now modified so that the header row stays
with the first non-header row for longtable output #252, #253.

- Consistent `BQL` / `BLQ` handling for column titles and table
notes for `pt_data_inventory()` #254, #255.

# pmtables 0.4.0

- Add `cols_omit` option to omit column header data (#213)
Expand All @@ -11,7 +27,7 @@
- Add `hline` argument to `rowgroup()` constructor to make the horizontal line
above the panel data optional (#215)

- Refactor `pt_data_inventory()` to calculate percent BLQ using denomninator
- Refactor `pt_data_inventory()` to calculate percent BLQ using denominator
that is the sum of the number of observations BLQ and non-BLQ / non-missing
(#221, #222)

Expand Down
1 change: 1 addition & 0 deletions R/AAAA.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ NULL

# GLOBAL object
.internal <- new.env(parent = emptyenv())
.internal$marker.panel <- "%--pmtables-insert-panel"

.onLoad <- function(libname, pkgname) {
st_reset_knit_deps()
Expand Down
59 changes: 40 additions & 19 deletions R/data_inventory_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -221,18 +221,18 @@ pt_data_study <- function(data, study_col = "STUDY", panel = study_col, ...) {
#'
#' @inheritParams pt_cont_long
#'
#' @param by the outer grouping variable; may be character or quosure
#' @param panel the panel grouping variable; may be character or quosure
#' @param inner_summary if `TRUE`, then a summary of the inner variable will
#' be provided
#' @param drop_miss if `TRUE`, then `MISS` will be dropped, but only when all
#' `MISS` values are equal to zero
#' @param stacked if `TRUE`, then independent summaries are created by `outer`
#' and included in a single table (see examples)
#' @param dv_col character name of `DV` column
#' @param bq_col character name of `BQL` column; see [find_bq_col()]
#' @param id_col character name of `ID` column
#' @param ... other arguments passed to [data_inventory_chunk()]
#' @param by The outer grouping variable; may be character or quosure.
#' @param panel The panel grouping variable; may be character or quosure.
#' @param inner_summary If `TRUE`, then a summary of the inner variable will
#' be provided.
#' @param drop_miss If `TRUE`, then `MISS` will be dropped, but only when all
#' `MISS` values are equal to zero.
#' @param stacked If `TRUE`, then independent summaries are created by `outer`
#' and included in a single table (see examples).
#' @param dv_col Character name of `DV` column.
#' @param bq_col Character name of `BQL` column; see [find_bq_col()].
#' @param id_col Character name of `ID` column.
#' @param ... Other arguments passed to [data_inventory_chunk()].
#'
#'
#' @details
Expand Down Expand Up @@ -303,7 +303,8 @@ pt_data_inventory <- function(data, by = ".total", panel = by,
all_name = "all",
dv_col = "DV",
bq_col = find_bq_col(data),
id_col = "ID", ...) {
id_col = "ID",
...) {

has_panel <- !missing(panel)
panel_data <- as.panel(panel)
Expand Down Expand Up @@ -375,14 +376,18 @@ pt_data_inventory <- function(data, by = ".total", panel = by,
Number.BQL = .data[["NBQL"]]
)

if(bq_col == "BLQ") {
names(ans) <- gsub(".BQL", ".BLQ", names(ans), fixed = TRUE)
}

if(isTRUE(drop_miss)) {
ans <- mutate(ans, Number.MISS = NULL)
}

ans <- mutate(ans,.total = NULL)
out <- ans

notes <- pt_data_inventory_notes()
notes <- pt_data_inventory_notes(bq = bq_col, drop_bql = drop_bql)

if(isTRUE(drop_miss)) notes <- notes[!grepl("MISS", notes)]

Expand Down Expand Up @@ -421,18 +426,34 @@ pt_data_inventory <- function(data, by = ".total", panel = by,

#' Return table notes for pt_data_inventory
#'
#' See [pt_data_inventory()].
#' See [pt_data_inventory()]. The function generates standard table notes for
#' the table.
#'
#' @param note_add additional notes to include
#' @param bq Abbreviation for below limit of quantification.
#' @param drop_bql If `TRUE`, the `BQL`/`BLQ` summary is omitted.
#' @param note_add Additional notes to be include.

#'
#' @export
pt_data_inventory_notes <- function(note_add = NULL) {
pt_data_inventory_notes <- function(bq = c("BQL", "BLQ"), drop_bql = FALSE, note_add = NULL) {
l2 <- NULL
l3 <- "MISS: missing observations"
if(isFALSE(drop_bql)) {
bq <- match.arg(bq)
if(bq=="BQL") {
l2 <- "BQL: below quantification limit"
}
if(bq=="BLQ") {
l2 <- "BLQ: below limit of quantification"
}
l3 <- paste0(l3, " (non-", bq, ")")
}
ans <- note_add
ans <- c(
ans,
"SUBJ: subjects",
"BQL: below quantitation limit",
"MISS: missing observations (not BQL)",
l2,
l3,
"OBS: observations"
)
ans
Expand Down
Loading

0 comments on commit cb6ae78

Please sign in to comment.