Skip to content

Commit

Permalink
Merge pull request #718 from metrumresearchgroup/release/1.12.0
Browse files Browse the repository at this point in the history
Release 1.12.0
  • Loading branch information
barrettk authored Sep 20, 2024
2 parents 03bec34 + b3f8778 commit c7ed5ef
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
37 changes: 37 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
# 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 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

## New features and changes
Expand Down
4 changes: 2 additions & 2 deletions R/bootstrap-model.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))})"
Expand Down
2 changes: 1 addition & 1 deletion man/setup_bootstrap_run.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c7ed5ef

Please sign in to comment.