diff --git a/.Rbuildignore b/.Rbuildignore index 980a70139..0585a773e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -22,4 +22,5 @@ TODO ^Meta$ Rplots.pdf ^pkgdown$ +⁠pkgdown/⁠ ^data-raw$ diff --git a/DESCRIPTION b/DESCRIPTION index 2df846ee1..218073fdb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: crmPack Title: Object-Oriented Implementation of CRM Designs -Version: 2.0.0.9158 +Version: 2.0.0.9000 Authors@R: c( person("Daniel", "Sabanes Bove", , "daniel.sabanes_bove@rconis.com", role = c("aut", "cre")), person("Wai", "Yin Yeung", , "winnie.yeung@roche.com", role = "aut"), @@ -33,7 +33,8 @@ Description: Implements a wide range of model-based dose escalation new models, escalation or stopping rules. Further details are presented in Sabanes Bove et al. (2019) . License: GPL (>= 2) -URL: https://github.com/openpharma/crmPack +URL: https://github.com/openpharma/crmPack, + https://openpharma.github.io/crmPack/ BugReports: https://github.com/openpharma/crmPack/issues Depends: ggplot2 (>= 2.0.0), diff --git a/NEWS.md b/NEWS.md index cca47023c..779e0c928 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# Version 2.0.0.9158 +# Version 2.0.0.9000 * **Note: This release (1.0 -> 2.0) signifies a major breaking revamp of the package.** Users are advised to carefully review the release notes and documentation for detailed information on the changes and any necessary updates to their existing code. * Implemented the `IncrementsMaxToxProb` class * Implemented `knit_print` methods for almost all `crmPack` classes to improve rendering in Markdown and Quarto documents. See the vignette for more details. diff --git a/R/Data-validity.R b/R/Data-validity.R index 08a0ffee8..9c9748855 100644 --- a/R/Data-validity.R +++ b/R/Data-validity.R @@ -182,8 +182,8 @@ v_data_da <- function(object) { } v$check( test_numeric(object@u, upper = object@Tmax, len = object@nObs, any.missing = FALSE) && - all(object@u > 0), - "u must be of type double, nObs length, non-negative and not greater than Tmax" + all(object@u >= 0), + "u must be of type double, nObs length, non-negative, not missing and not greater than Tmax" ) v$check( test_numeric(object@t0, lower = 0, len = object@nObs, any.missing = FALSE, sorted = TRUE), diff --git a/tests/testthat/_snaps/Design-methods.md b/tests/testthat/_snaps/Design-methods.md index 51a305cc9..dda5a1b36 100644 --- a/tests/testthat/_snaps/Design-methods.md +++ b/tests/testthat/_snaps/Design-methods.md @@ -605,7 +605,7 @@ result Output An object of class "PseudoDualSimulations" - Slot "fitEff": + Slot "fit_eff": [[1]] [[1]]$theta1 [1] -4.20662 @@ -619,13 +619,13 @@ - Slot "FinalGstarEstimates": + Slot "final_gstar_estimates": [1] 146.2479 - Slot "FinalGstarAtDoseGrid": + Slot "final_gstar_at_dose_grid": [1] 125 - Slot "FinalGstarCIs": + Slot "final_gstar_cis": [[1]] [[1]]$lower [1] 75.03531 @@ -635,16 +635,16 @@ - Slot "FinalGstarRatios": + Slot "final_gstar_ratios": [1] 3.798815 - Slot "FinalOptimalDose": + Slot "final_optimal_dose": [1] 137.5996 - Slot "FinalOptimalDoseAtDoseGrid": + Slot "final_optimal_dose_at_dose_grid": [1] 125 - Slot "sigma2est": + Slot "sigma2_est": [1] 0.1616952 Slot "fit": @@ -765,7 +765,7 @@ result Output An object of class "PseudoDualSimulations" - Slot "fitEff": + Slot "fit_eff": [[1]] middle lower upper 1 -0.3079474 -0.8521410 0.08196096 @@ -782,13 +782,13 @@ 12 1.6915134 1.2623492 2.22318756 - Slot "FinalGstarEstimates": + Slot "final_gstar_estimates": [1] 300 - Slot "FinalGstarAtDoseGrid": + Slot "final_gstar_at_dose_grid": [1] 225 - Slot "FinalGstarCIs": + Slot "final_gstar_cis": [[1]] [[1]]$lower [1] 300 @@ -798,16 +798,16 @@ - Slot "FinalGstarRatios": + Slot "final_gstar_ratios": [1] 1 - Slot "FinalOptimalDose": + Slot "final_optimal_dose": [1] 62.78087 - Slot "FinalOptimalDoseAtDoseGrid": + Slot "final_optimal_dose_at_dose_grid": [1] 50 - Slot "sigma2est": + Slot "sigma2_est": [1] 0.2648646 Slot "fit": diff --git a/tests/testthat/test-Data-validity.R b/tests/testthat/test-Data-validity.R index 21fcf5b9c..b4ae84d00 100644 --- a/tests/testthat/test-Data-validity.R +++ b/tests/testthat/test-Data-validity.R @@ -242,7 +242,7 @@ test_that("v_data_da: error for u of wrong length and values", { expect_equal( v_data_da(object), - "u must be of type double, nObs length, non-negative and not greater than Tmax" # nolintr + "u must be of type double, nObs length, non-negative, not missing and not greater than Tmax" # nolintr ) }) diff --git a/vignettes/example.Rmd b/vignettes/example.Rmd index 647016bf8..fad61b827 100644 --- a/vignettes/example.Rmd +++ b/vignettes/example.Rmd @@ -821,7 +821,7 @@ All of the stopping rules classes inherit directly from the `Stopping` class. Th From the names of these stopping rules, we can have an idea of what criteria have been used for stopping decisions and we will explain briefly here what are these criteria. For further details please refer to examples presented later in this vignette or examples given in the help pages. You can find a link to all implemented stopping rule parts in the help page `Stopping-class`. -For example, `StoppingCohortNearDose` class objects can be used to stop the dose escalation based on the numbers of cohorts treated near to the next best dose (where the required proximity is given as the percentage of relative deviation from the next best dose). Similarly, for `StoppingPatientsNearDose`, stopping is based on the number of patients treated near the next best dose. `StoppingMinCohorts` and `StoppingMinPatients` rules can be used to stop the dose escalation if a minimum overall number of patients or cohorts have been enrolled. We have also other stopping rules such that a trial will be stopped either based on the MTD distribution (`StoppingMTDdistribution`), or reached a pre-specified probability of the next dose being in the target toxicity interval (`StoppingTargetProb`) or or target biomarker interval (`StoppingTargetBiomarker`) or when the current estimate of the quantity of interest is 'accurate' enough (`StoppingTDCIRatio` and `StoppingMaxGainCIRatio`) +For example, `StoppingCohortNearDose` class objects can be used to stop the dose escalation based on the numbers of cohorts treated near to the next best dose (where the required proximity is given as the percentage of relative deviation from the next best dose). Similarly, for `StoppingPatientsNearDose`, stopping is based on the number of patients treated near the next best dose. `StoppingMinCohorts` and `StoppingMinPatients` rules can be used to stop the dose escalation if a minimum overall number of patients or cohorts have been enrolled. We have also other stopping rules such that a trial will be stopped either based on the MTD distribution (`StoppingMTDdistribution`), or reached a pre-specified probability of the next dose being in the target toxicity interval (`StoppingTargetProb`) or target biomarker interval (`StoppingTargetBiomarker`) or when the current estimate of the quantity of interest is 'accurate' enough (`StoppingTDCIRatio` and `StoppingMaxGainCIRatio`) Stopping rules are often quite complex, because they are built from "and/or" combinations of multiple parts. Therefore the `crmPack` implementation mirrors this, and multiple atomic stopping rules can be combined easily. For example, let's assume diff --git a/vignettes/knit_print.qmd b/vignettes/knit_print.Rmd similarity index 97% rename from vignettes/knit_print.qmd rename to vignettes/knit_print.Rmd index 5836ce777..c8502d48b 100644 --- a/vignettes/knit_print.qmd +++ b/vignettes/knit_print.Rmd @@ -9,11 +9,11 @@ citation-location: margin bibliography: vignettes.bib vignette: > %\VignetteIndexEntry{demo} - %\VignetteEngine{quarto::html} + %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- -```{r} +```{r, label = "setup"} #| label: setup #| echo: FALSE @@ -61,7 +61,7 @@ cs > The `knit_print`methods provided by `crmPack` are not intended to be fully customisable or > comprehensive. We do believe, however, that they cover the vast majority of use-cases and are -> easily extended using the techniques described in @sec-override of this vignette. +> easily extended using the techniques described later in this vignette. > Formatting of these objects currently only works for HMTL output. If another format - such as PDF > or Microsoft Word - is required, our suggested workaround is to create the HTML output and then @@ -216,7 +216,7 @@ knit_print( ) ``` -\[Output not shown.\] +$$Output not shown.$$ > It is not possible to omit slots from the rendition of a `crmPack` object. If you need to do this, > you can either render the required slots individually, or override the definition of `knit_print` @@ -286,7 +286,9 @@ As an example, consider `knit_print.NextBestNCRM`, which currently returns a par You might feel this is better presented as a bulleted list. You can achieve this as follows[^3]: -[^3]: For simplicity, the `tox_label` and `asis` parameters, which are defined in the current implementation of the function, are omitted in this custom implementation. They should be preserved in any "real world" customisation. +[^3]: For simplicity, the `tox_label` and `asis` parameters, which are defined in the current + implementation of the function, are omitted in this custom implementation. They should be + preserved in any "real world" customisation. ```{r} #| label: override-2