From 39fd54748b2051a33f8cefa9f6cd7a2bd284691d Mon Sep 17 00:00:00 2001 From: Kyle Barrett Date: Thu, 19 Sep 2024 19:04:12 -0400 Subject: [PATCH 1/4] Increment version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5758f885..b66417a4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: bbr Title: R package for bbi -Version: 1.11.0 +Version: 1.12.0 Authors@R: c(person(given = "Seth", family = "Green", From 2e8ff403f1ca9c859e9fb0302806a238d532893f Mon Sep 17 00:00:00 2001 From: Kyle Barrett Date: Thu, 19 Sep 2024 19:04:46 -0400 Subject: [PATCH 2/4] update NEWS --- NEWS.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/NEWS.md b/NEWS.md index a40a0c84..2b3fa9de 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,41 @@ +# bbr 1.12.0 + +## New features and changes + +* New Model Tree feature: `bbr` now allows you to visualize any `run_log()` as + an interactive model tree diagram via `model_tree()`. This function allows + users to easily visualize and track the modeling process for a given project + and display any information available in a `run_log()`, such as model summary + information, configuration options, and more. See the vignette + [here](https://metrumresearchgroup.github.io/bbr/articles/model-tree.html) (#673). + +* New `run_nmtran()` function for running `NM-TRAN` on a model object to validate + its control stream for correct coding before submission. The `NM-TRAN` dataset + (`FDATA`) and other `NONMEM` artifacts can be further inspected by keeping the + run directory around (#705). + +* `nm_data()` now has a `filter` argument, allowing the user to filter data based + on `IGNORE LIST` or `ACCEPT LIST` options defined in the `$DATA` record of a + `NONMEM` control stream file (#711). + +* `setup_bootstrap_run()` now has a `data` argument, allowing users to provide + their own starting dataset to resample from. This defaults to `NULL`, which + will use the output from `nm_data(.boot_run, filter = TRUE)` (#707, #711). + +## Bugs addressed + +* Bootstrap adjustment: previously `setup_bootstrap_run()` assumed a `NUM` column + was present in the input dataset (the default `.join_col` in `nm_join()`). + `nm_join()` was being used in the back-end to create the starting dataset to + resample from; the intention being to only include subjects that entered the + original problem. Given the `nm_join()` use, this also required that the original + model had finished executing before bootstrapping. Rather than using `nm_join()` + by default, we now use `nm_data(.boot_run, filter = TRUE)`. This both fixes the + aforementioned bug and removes the need for the based on model (the model being + bootstrapped) from needing to have been executed. If the model has been executed + however, we will check the number of records to ensure the filtering was done + correctly (#707, #711). + # bbr 1.11.0 ## New features and changes From 37a039d39809920fb2764ffedadce404b54b407b Mon Sep 17 00:00:00 2001 From: Kyle Barrett Date: Thu, 19 Sep 2024 19:08:50 -0400 Subject: [PATCH 3/4] Documentation and error message fix - Towards the end of PR #711 I changed which model was passed to `nm_data(filter = TRUE)`. While updating the NEWS I realized some parameter documentation and an error message were not consistent with this change. - Minor enough to include in this PR --- R/bootstrap-model.R | 4 ++-- man/setup_bootstrap_run.Rd | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/bootstrap-model.R b/R/bootstrap-model.R index 60e4cca2..da7fc6eb 100644 --- a/R/bootstrap-model.R +++ b/R/bootstrap-model.R @@ -86,7 +86,7 @@ new_bootstrap_run <- function( #' @param seed A numeric seed to set prior to resampling the data; use `NULL` to #' avoid setting a seed. #' @param data A dataset to resample from. Defaults to `NULL`, which will use -#' the _filtered_ output from `nm_data(.mod, filter = TRUE)`. If provided, +#' the _filtered_ output from `nm_data(.boot_run, filter = TRUE)`. If provided, #' must include the same column names as what's returned from `nm_data(.mod)`. #' @param .bbi_args Named list passed to `model_summary(orig_mod, .bbi_args)`, #' where `orig_mod` is the model `.boot_run` is based on. See @@ -212,7 +212,7 @@ setup_bootstrap_run <- function( cli::cli_abort( c( "!" = "The filtered dataset does not have the same number of records as the original model:", - "*" = "{.code nm_data(orig_mod, filter = TRUE)} returned {.val {nrec_f}} records", + "*" = "{.code nm_data(.boot_run, filter = TRUE)} returned {.val {nrec_f}} records", "*" = "{.code model_summary(orig_mod)} returned {.val {nrec}} records", "i" = "where {.code orig_mod <- read_model(get_based_on(.boot_run))}", "i" = "Try providing a starting dataset (e.g., {.code setup_bootstrap_run(.boot_run, data = nm_join(orig_mod))})" diff --git a/man/setup_bootstrap_run.Rd b/man/setup_bootstrap_run.Rd index 0537c591..63018466 100644 --- a/man/setup_bootstrap_run.Rd +++ b/man/setup_bootstrap_run.Rd @@ -25,7 +25,7 @@ setup_bootstrap_run( avoid setting a seed.} \item{data}{A dataset to resample from. Defaults to \code{NULL}, which will use -the \emph{filtered} output from \code{nm_data(.mod, filter = TRUE)}. If provided, +the \emph{filtered} output from \code{nm_data(.boot_run, filter = TRUE)}. If provided, must include the same column names as what's returned from \code{nm_data(.mod)}.} \item{.bbi_args}{Named list passed to \code{model_summary(orig_mod, .bbi_args)}, From b3f8778ed98f82d7a6514c6967e7c4dd6bea1435 Mon Sep 17 00:00:00 2001 From: Kyle Barrett Date: Fri, 20 Sep 2024 09:41:08 -0400 Subject: [PATCH 4/4] adjust NEWS --- NEWS.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 2b3fa9de..6909f648 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,7 @@ ## New features and changes -* New Model Tree feature: `bbr` now allows you to visualize any `run_log()` as +* New model tree feature: `bbr` now allows you to visualize any `run_log()` as an interactive model tree diagram via `model_tree()`. This function allows users to easily visualize and track the modeling process for a given project and display any information available in a `run_log()`, such as model summary @@ -31,10 +31,9 @@ original problem. Given the `nm_join()` use, this also required that the original model had finished executing before bootstrapping. Rather than using `nm_join()` by default, we now use `nm_data(.boot_run, filter = TRUE)`. This both fixes the - aforementioned bug and removes the need for the based on model (the model being - bootstrapped) from needing to have been executed. If the model has been executed - however, we will check the number of records to ensure the filtering was done - correctly (#707, #711). + aforementioned bug and removes the requirement that the base model (model being + bootstrapped) has been executed. If the model has been executed, however, we will + check the number of records to ensure the filtering was done correctly (#707, #711). # bbr 1.11.0