Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/INCEPTdk/adaptr
Browse files Browse the repository at this point in the history
  • Loading branch information
agranholm committed Aug 16, 2022
2 parents e52486f + d85648e commit 696f401
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 21 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: adaptr
Title: Adaptive Trial Simulator
Version: 1.1.0
Date: 2022-06-16
Version: 1.1.1
Date: 2022-08-16
Authors@R:
c(person("Anders", "Granholm",
email = "[email protected]",
Expand Down
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# adaptr 1.1.1

This is a patch release triggered by a CRAN request for updates.

* Minor formatting changes to the `adaptr-package` help page to comply with CRAN
request to only use HTML5 (as used by R >=4.2.0).

* Minor bugfixes in print methods for trial specifications and summaries of
multiple trial results.

* Minor updates in messages in setup_trial.

# adaptr 1.1.0

Minor release:
Expand Down
5 changes: 4 additions & 1 deletion R/adaptr-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
#' @aliases adaptr
#'
#' @description
#' \if{html}{\figure{adaptr.png}{options: align="right" width="120" alt="logo"}}
#' \if{html}{
#' \figure{adaptr.png}{options: width="120" alt="logo"}
#' \emph{Adaptive Trial Simulator}
#' }
#'
#' The `adaptr` package simulates adaptive (multi-arm) trials using adaptive
#' stopping, adaptive arm dropping and/or response-adaptive randomisation.
Expand Down
4 changes: 2 additions & 2 deletions R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ print.trial_spec <- function(x, prob_digits = 3, ...) {
cat("* Control arm probability matched to best non-control arm")
} else {
cat0("* Control arm probability fixed at ",
round(x$control_prob_fixed), prob_digits) # Fixed at same value all the time
round(x$control_prob_fixed, prob_digits)) # Fixed at same value all the time
}
} else {
cat0("* Control arm probability fixed at ")
Expand Down Expand Up @@ -308,7 +308,7 @@ print.trial_results_summary <- function(x, digits = 1, ...) {
character(1)), collapse = " | "), "\n",
"* RMSE: ", fmt_dig(x$rmse, 5), "\n",
"* RMSE treatment effect: ", ifelse(is.na(x$rmse_te), "not estimated", fmt_dig(x$rmse_te, 5)), "\n",
"* Ideal design percentage: ", fmt_dig(x$idp, digits), "%",
"* Ideal design percentage: ", ifelse(is.nan(x$idp), "not estimable", paste0(fmt_dig(x$idp, digits), "%")),

# Technical simulation details
"\n\nSimulation details:",
Expand Down
2 changes: 1 addition & 1 deletion R/setup_trial.R
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ validate_trial <- function(arms, true_ys, start_probs = NULL,
best_arm <- arms[true_ys == ifelse(highest_is_best, max(true_ys), min(true_ys))]
if (length(best_arm) > 1) {
message(paste0("Notice: trial specification does not contain a single superior arm -", "
multiple arms have the best value in true_ys: ", paste0(best_arm, collapse = " and ")))
multiple arms have the best value in true_ys: ", paste0(best_arm, collapse = ", ")))
}

# Validate Bayesian settings
Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ The full package documentation is available as a stand-alone website at [inceptd
# The easiest way is to install from CRAN directly
install.packages("adaptr")
# But you can also get the newest version from GitHub (requires the remotes package)
# But you can also install the development version from GitHub (requires the remotes package)
# install.packages("remotes")
remotes::install_github("INCEPTdk/adaptr")
remotes::install_github("INCEPTdk/adaptr@dev")
```

## Example
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ The full package documentation is available as a stand-alone website at
# The easiest way is to install from CRAN directly
install.packages("adaptr")

# But you can also get the newest version from GitHub (requires the remotes package)
# But you can also install the development version from GitHub (requires the remotes package)
# install.packages("remotes")
remotes::install_github("INCEPTdk/adaptr")
remotes::install_github("INCEPTdk/adaptr@dev")
```

## Example
Expand All @@ -46,7 +46,7 @@ general `setup_trial()` function, or one of the special case functions,

``` r
library(adaptr)
#> Loading adaptr package (version 1.1.0).
#> Loading adaptr package (version 1.1.1).
#> See 'help("adaptr")' or 'vignette("Overview", "adaptr")' for help.
#> Further information available on https://inceptdk.github.io/adaptr/.

Expand Down Expand Up @@ -171,7 +171,7 @@ print(res_sum, digits = 1)
#> * Ideal design percentage: 100.0%
#>
#> Simulation details:
#> * Simulation time: 0.388 secs
#> * Simulation time: 0.413 secs
#> * Base random seed: 67890
#> * Credible interval width: 95%
#> * Number of posterior draws: 5000
Expand Down
11 changes: 3 additions & 8 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
## Resubmission

This is a resubmission of a minor release, fixing a moved URL and an invalid
file URI in a function documentation. Comments for original submission below.

## Release summary

This is a minor patch release updating documentation, adding limited new
functionality, and updating an internal function due to updates to the
`&&`-function in R >= 4.2.0.
This is a minor patch release triggered by a CRAN request for updates to the
package documentation to only use HTML5, which also includes minor bugfixes to
print methods and messages in the setup_trial function.

## R CMD check results

Expand Down
5 changes: 4 additions & 1 deletion man/adaptr-package.Rd

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

0 comments on commit 696f401

Please sign in to comment.