diff --git a/.Rbuildignore b/.Rbuildignore index cd9c03b3..7bb08579 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -19,6 +19,7 @@ ^inst/extdata/vaccine_jags\.RData$ ^inst/extdata/statins_base\.RData$ ^inst/extdata/statins_HC\.RData$ +^inst/extdata/smoking_output\.RData$ ^paper\.bib$ ^paper\.md$ ^CONTRIBUTING\.md$ diff --git a/.gitignore b/.gitignore index 19b6b853..dd9a9f08 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ BCEA.Rcheck/ *.Rproj inst/doc renv/ -BCEA_book.pdf - Shortcut \ No newline at end of file +revdep/ +BCEA_book.pdf - Shortcut diff --git a/DESCRIPTION b/DESCRIPTION index 56e83ef2..2db97687 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,7 +22,7 @@ Authors@R: c( Imports: cli (>= 3.3.0), dplyr, - ggplot2, + ggplot2 (>= 3.4.0), graphics, gridExtra, MASS, @@ -32,6 +32,7 @@ Imports: Rdpack, reshape2, rlang, + rstan, scales, voi Depends: @@ -47,14 +48,12 @@ Suggests: RColorBrewer, rjags, rmarkdown, - rstan, splancs, testthat (>= 2.1.0), vdiffr, withr RdMacros: Rdpack VignetteBuilder: knitr -Additional_repositories: https://inla.r-inla-download.org/R/testing/ Description: Produces an economic evaluation of a sample of suitable variables of cost and effectiveness / utility for two or more interventions, e.g. from a Bayesian model in the form of MCMC simulations. @@ -69,8 +68,6 @@ NeedsCompilation: no RoxygenNote: 7.2.3.9000 Encoding: UTF-8 BugReports: https://github.com/n8thangreen/BCEA/issues/ -Remotes: - chjackson/voi, - plotrix/plotrix LazyData: false Roxygen: list(markdown = TRUE) + diff --git a/NAMESPACE b/NAMESPACE index bbdfef24..67fcab31 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -138,6 +138,7 @@ importFrom(purrr,pluck) importFrom(reshape2,melt) importFrom(rlang,.data) importFrom(rlang,int) +importFrom(rstan,extract) importFrom(scales,label_dollar) importFrom(stats,as.formula) importFrom(stats,cov) diff --git a/R/add_contour_quadrants.R b/R/add_contour_quadrants.R index b9287dbe..c74baeca 100644 --- a/R/add_contour_quadrants.R +++ b/R/add_contour_quadrants.R @@ -42,7 +42,7 @@ add_contour_quadrants <- function(he, params) { #' Geom Quadrant Text #' #' @template args-he -#' @template args-graph +#' @param graph_param Plot parameters; list #' @keywords internal aplot #' geom_quad_txt <- function(he, graph_params) { diff --git a/R/bcea.default.R b/R/bcea.default.R index 21cd956a..3334e0d0 100644 --- a/R/bcea.default.R +++ b/R/bcea.default.R @@ -108,6 +108,7 @@ bcea.rjags <- function(eff, ...) { #' @rdname bcea #' @param ... Additional arguments +#' @importFrom rstan extract #' @export bcea.rstan <- function(eff, ...) { diff --git a/R/ce_table.R b/R/ce_table.R index 2400c133..19c99164 100644 --- a/R/ce_table.R +++ b/R/ce_table.R @@ -49,6 +49,10 @@ ce_table <- function(he, #' comparison label and associated ICER #' #' @export +#' @examples +#' data("Smoking") +#' he <- BCEA::bcea(eff, cost) +#' tabulate_means(he) #' tabulate_means <- function(he, comp_label = NULL, diff --git a/R/ceac_plot_graph.R b/R/ceac_plot_graph.R index b89d0b5f..1e403963 100644 --- a/R/ceac_plot_graph.R +++ b/R/ceac_plot_graph.R @@ -136,7 +136,7 @@ ceac_ggplot <- function(he, ggplot(data_psa, aes(x = .data$k, y = .data$ceac)) + geom_line(aes(linetype = .data$comparison, - size = factor(.data$comparison), + linewidth = factor(.data$comparison), colour = factor(.data$comparison))) + theme_ceac() + theme_add + # theme diff --git a/R/contour_ggplot_params.R b/R/contour_ggplot_params.R index 877b3f07..751f3eeb 100644 --- a/R/contour_ggplot_params.R +++ b/R/contour_ggplot_params.R @@ -2,7 +2,6 @@ #' Contour ggplot Parameters #' #' @template args-he -#' @param pos_legend Position of legend #' @param graph_params Other graphical parameters #' @param ... Additional arguments #' diff --git a/R/ib.plot.R b/R/ib.plot.R index e5b7b370..3d80c64c 100644 --- a/R/ib.plot.R +++ b/R/ib.plot.R @@ -25,14 +25,23 @@ #' @author Gianluca Baio, Andrea Berardi #' @seealso [bcea()], #' [ceplane.plot()] -#' @importFrom Rdpack reprompt -#' #' @references +#' #' \insertRef{Baio2011}{BCEA} +#' #' \insertRef{Baio2013}{BCEA} #' +#' @keywords hplot #' @export #' +#' @import ggplot2 +#' @importFrom Rdpack reprompt +#' +#' @examples +#' data("Vaccine") +#' he <- BCEA::bcea(eff, cost) +#' ib.plot(he) +#' ib.plot.bcea <- function(he, comparison = NULL, wtp = 25000, diff --git a/cran-comments.md b/cran-comments.md index 1e88fbc5..00beefb6 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,30 +1,7 @@ - -# Resubmission (2.4.4) - -* Suggested package wasn't used conditionally in unit test causing CRAN check error. `MCMCvis` is now moved to Required packages. -* Fixed R package CRAN webpage canonical form in README - ## R CMD check results -0 errors | 0 warnings | 1 note - -* Any notes about using INLA has been condoned in previous versions, as they are only suggested. - -CHECK message: - - Suggests or Enhances not in mainstream repositories: - INLA - Availability using Additional_repositories specification: - INLA yes https://inla.r-inla-download.org/R/stable/ - -Flavor: r-devel-linux-x86_64-debian-gcc, r-devel-windows-x86_64 -Check: package dependencies, Result: NOTE - Package suggested but not available for checking: 'INLA' - -## Downstream dependencies - -We checked 2 reverse dependencies (missingHE, heesim), comparing R CMD check results across CRAN and dev versions of this package. +0 errors | 0 warnings | 0 note -* We saw 0 new problems -* We failed to check 0 packages +* This is an updated release. +Previous versions depended directly on INLA which is now not the case diff --git a/inst/rmarkdown/report/report.pdf b/inst/rmarkdown/report/report.pdf deleted file mode 100644 index 70d5a5fc..00000000 Binary files a/inst/rmarkdown/report/report.pdf and /dev/null differ diff --git a/inst/rmarkdown/report/section_ceplane.Rmd.save b/inst/rmarkdown/report/section_ceplane.Rmd.save deleted file mode 100644 index 6ac04b8a..00000000 --- a/inst/rmarkdown/report/section_ceplane.Rmd.save +++ /dev/null @@ -1,21 +0,0 @@ - -## Cost-effectiveness plane - -The following graph shows the _cost-effectiveness plane_. This presents the joint distribution of the population average benefit and cost differential, $(\Delta_e,\Delta_c)$ and can be used to assess the uncertainty underlying the decision-making problem. - -Each point in the graph represents a 'potential future' in terms of expected incremental economic outcomes. The shaded portion of the plane is the _'sustainability area'_. The more points lay in the sustainability area, the more likely that the reference intervention will turn out to be cost-effective, at a given willingness to pay threshold, $k$ (in this case selected at $k=$ `r rmd_ -params$wtp`). - - -```{r, echo=echo, fig.width=4.6, fig.height=4.6, fig.align=align, warning=FALSE, message=FALSE, comment=NA} -n.ints <- m$n_comparators - -if (n.ints == 2) { - graph <- "base" - pos <- c(1, 1) -} else { - graph <- "ggplot2" - pos <- TRUE -} -ceplane.plot(m, graph = graph, pos = pos, wtp = rmd_params$wtp) -``` diff --git a/man/contour_ggplot_params.Rd b/man/contour_ggplot_params.Rd index 19309d31..bb9cd0bd 100644 --- a/man/contour_ggplot_params.Rd +++ b/man/contour_ggplot_params.Rd @@ -13,8 +13,6 @@ modelling and the economic evaluation.} \item{graph_params}{Other graphical parameters} \item{...}{Additional arguments} - -\item{pos_legend}{Position of legend} } \description{ Contour ggplot Parameters diff --git a/man/geom_quad_txt.Rd b/man/geom_quad_txt.Rd index 2f58e336..ff11c59c 100644 --- a/man/geom_quad_txt.Rd +++ b/man/geom_quad_txt.Rd @@ -10,10 +10,7 @@ geom_quad_txt(he, graph_params) \item{he}{A \code{bcea} object containing the results of the Bayesian modelling and the economic evaluation.} -\item{graph}{A string used to select the graphical engine to use for -plotting. Should (partial-)match the three options \code{"base"}, -\code{"ggplot2"} or \code{"plotly"}. Default value is \code{"base"}. -Not all plotting functions have a \code{"plotly"} implementation yet.} +\item{graph_param}{Plot parameters; list} } \description{ Geom Quadrant Text diff --git a/man/ib.plot.Rd b/man/ib.plot.Rd index 224c4c62..46706ee8 100644 --- a/man/ib.plot.Rd +++ b/man/ib.plot.Rd @@ -55,9 +55,16 @@ comparator). \description{ Plots the distribution of the Incremental Benefit (IB) for a given value of the willingness to pay threshold. +} +\examples{ +data("Vaccine") +he <- BCEA::bcea(eff, cost) +ib.plot(he) + } \references{ \insertRef{Baio2011}{BCEA} + \insertRef{Baio2013}{BCEA} } \seealso{ @@ -67,3 +74,4 @@ the willingness to pay threshold. \author{ Gianluca Baio, Andrea Berardi } +\keyword{hplot} diff --git a/man/tabulate_means.Rd b/man/tabulate_means.Rd index f55dd248..82a4a668 100644 --- a/man/tabulate_means.Rd +++ b/man/tabulate_means.Rd @@ -21,3 +21,9 @@ comparison label and associated ICER \description{ Calculate Dataset For ICERs From bcea Object } +\examples{ +data("Smoking") +he <- BCEA::bcea(eff, cost) +tabulate_means(he) + +} diff --git a/revdep/.gitignore b/revdep/.gitignore deleted file mode 100644 index 111ab324..00000000 --- a/revdep/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -checks -library -checks.noindex -library.noindex -cloud.noindex -data.sqlite -*.html diff --git a/revdep/README.md b/revdep/README.md index b84c4299..fd53a526 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -1,62 +1,108 @@ # Platform -|field |value | -|:--------|:-----------------------------------------| -|version |R version 4.2.0 (2022-04-22 ucrt) | -|os |Windows 10 x64 (build 22000) | -|system |x86_64, mingw32 | -|ui |RStudio | -|language |(EN) | -|collate |English_United Kingdom.utf8 | -|ctype |English_United Kingdom.utf8 | -|tz |Europe/London | -|date |2022-08-22 | -|rstudio |2022.07.1+554 Spotted Wakerobin (desktop) | -|pandoc |NA | +|field |value | +|:--------|:------------------------------------------------| +|version |R version 4.2.2 Patched (2022-11-06 r83320 ucrt) | +|os |Windows 10 x64 (build 22621) | +|system |x86_64, mingw32 | +|ui |RStudio | +|language |(EN) | +|collate |English_United Kingdom.utf8 | +|ctype |English_United Kingdom.utf8 | +|tz |Europe/London | +|date |2023-11-21 | +|rstudio |2023.09.1+494 Desert Sunflower (desktop) | +|pandoc |NA | # Dependencies -|package |old |new |Δ | -|:--------------|:------|:------|:--| -|BCEA |2.4.1 |2.4.2 |* | -|cli |3.3.0 |3.3.0 | | -|colorspace |2.0-3 |2.0-3 | | -|digest |0.6.29 |0.6.29 | | -|dplyr |1.0.9 |1.0.9 | | -|ellipsis |0.3.2 |0.3.2 | | -|fansi |1.0.3 |1.0.3 | | -|farver |2.1.1 |2.1.1 | | -|generics |0.1.3 |0.1.3 | | -|ggplot2 |3.3.6 |3.3.6 | | -|glue |1.6.2 |1.6.2 | | -|GrassmannOptim |2.0.1 |2.0.1 | | -|gridExtra |2.3 |2.3 | | -|gtable |0.3.0 |0.3.0 | | -|isoband |0.2.5 |0.2.5 | | -|labeling |0.4.2 |0.4.2 | | -|lifecycle |1.0.1 |1.0.1 | | -|magrittr |2.0.3 |2.0.3 | | -|munsell |0.5.0 |0.5.0 | | -|pillar |1.8.1 |1.8.1 | | -|pkgconfig |2.0.3 |2.0.3 | | -|plyr |1.8.7 |1.8.7 | | -|purrr |0.3.4 |0.3.4 | | -|R6 |2.5.1 |2.5.1 | | -|rbibutils |NA |2.2.9 |* | -|RColorBrewer |1.1-3 |1.1-3 | | -|Rcpp |1.0.9 |1.0.9 | | -|Rdpack |NA |2.4 |* | -|reshape2 |1.4.4 |1.4.4 | | -|rlang |1.0.4 |1.0.4 | | -|scales |1.2.1 |1.2.1 | | -|stringi |1.7.8 |1.7.8 | | -|stringr |1.4.1 |1.4.1 | | -|tibble |3.1.8 |3.1.8 | | -|tidyselect |1.1.2 |1.1.2 | | -|utf8 |1.2.2 |1.2.2 | | -|vctrs |0.4.1 |0.4.1 | | -|viridisLite |0.4.0 |0.4.0 | | -|withr |2.5.0 |2.5.0 | | +|package |old |new |Δ | +|:--------------|:---------|:----------|:--| +|BCEA |2.4.4 |2.4.5 |* | +|abind |NA |1.4-5 |* | +|backports |1.4.1 |1.4.1 | | +|BH |1.81.0-1 |1.81.0-1 | | +|brio |1.1.3 |1.1.3 | | +|callr |3.7.3 |3.7.3 | | +|checkmate |2.3.0 |2.3.0 | | +|cli |3.6.1 |3.6.1 | | +|coda |0.19-4 |0.19-4 | | +|colorspace |2.1-0 |2.1-0 | | +|crayon |1.5.2 |1.5.2 | | +|dbarts |NA |0.9-23 |* | +|desc |1.4.2 |1.4.2 | | +|diffobj |0.3.5 |0.3.5 | | +|digest |0.6.33 |0.6.33 | | +|distributional |NA |0.3.2 |* | +|dplyr |1.1.4 |1.1.4 | | +|earth |NA |5.3.2 |* | +|ellipsis |0.3.2 |0.3.2 | | +|evaluate |0.23 |0.23 | | +|fansi |1.0.5 |1.0.5 | | +|farver |2.1.1 |2.1.1 | | +|Formula |NA |1.2-5 |* | +|fs |1.6.3 |1.6.3 | | +|generics |0.1.3 |0.1.3 | | +|ggplot2 |3.4.4 |3.4.4 | | +|glue |1.6.2 |1.6.2 | | +|gridExtra |2.3 |2.3 | | +|gtable |0.3.4 |0.3.4 | | +|hms |NA |1.1.3 |* | +|inline |0.3.19 |0.3.19 | | +|isoband |0.2.7 |0.2.7 | | +|jsonlite |1.8.7 |1.8.7 | | +|labeling |0.4.3 |0.4.3 | | +|lifecycle |1.0.4 |1.0.4 | | +|loo |2.6.0 |2.6.0 | | +|magrittr |2.0.3 |2.0.3 | | +|matrixStats |1.1.0 |1.1.0 | | +|MCMCvis |0.16.3 |0.16.3 | | +|munsell |0.5.0 |0.5.0 | | +|mvtnorm |NA |1.2-3 |* | +|numDeriv |NA |2016.8-1.1 |* | +|overlapping |2.1 |2.1 | | +|pillar |1.9.0 |1.9.0 | | +|pkgbuild |1.4.2 |1.4.2 | | +|pkgconfig |2.0.3 |2.0.3 | | +|pkgload |1.3.3 |1.3.3 | | +|plotmo |NA |3.6.2 |* | +|plotrix |NA |3.8-4 |* | +|plyr |1.8.9 |1.8.9 | | +|posterior |NA |1.5.0 |* | +|praise |1.0.0 |1.0.0 | | +|prettyunits |1.2.0 |1.2.0 | | +|processx |3.8.2 |3.8.2 | | +|progress |NA |1.2.2 |* | +|ps |1.7.5 |1.7.5 | | +|purrr |1.0.2 |1.0.2 | | +|QuickJSR |1.0.7 |1.0.7 | | +|R6 |2.5.1 |2.5.1 | | +|rbibutils |2.2.16 |2.2.16 | | +|RColorBrewer |1.1-3 |1.1-3 | | +|Rcpp |1.0.11 |1.0.11 | | +|RcppEigen |0.3.3.9.4 |0.3.3.9.4 | | +|RcppParallel |5.1.7 |5.1.7 | | +|Rdpack |2.6 |2.6 | | +|rematch2 |2.1.2 |2.1.2 | | +|reshape2 |1.4.4 |1.4.4 | | +|rlang |1.1.2 |1.1.2 | | +|rprojroot |2.0.4 |2.0.4 | | +|rstan |2.32.3 |2.32.3 | | +|scales |1.2.1 |1.2.1 | | +|StanHeaders |2.26.28 |2.26.28 | | +|stringi |1.8.1 |1.8.1 | | +|stringr |1.5.1 |1.5.1 | | +|TeachingDemos |NA |2.12 |* | +|tensorA |NA |0.36.2 |* | +|testthat |3.2.0 |3.2.0 | | +|tibble |3.2.1 |3.2.1 | | +|tidyselect |1.2.0 |1.2.0 | | +|utf8 |1.2.4 |1.2.4 | | +|vctrs |0.6.4 |0.6.4 | | +|viridisLite |0.4.2 |0.4.2 | | +|voi |NA |1.0 |* | +|waldo |0.5.2 |0.5.2 | | +|withr |2.5.2 |2.5.2 | | # Revdeps diff --git a/revdep/cran.md b/revdep/cran.md index d07935b8..29c19611 100644 --- a/revdep/cran.md +++ b/revdep/cran.md @@ -1,6 +1,6 @@ ## revdepcheck results -We checked 2 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. +We checked 3 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. * We saw 0 new problems * We failed to check 0 packages diff --git a/revdep/email.yml b/revdep/email.yml deleted file mode 100644 index 0c5cef87..00000000 --- a/revdep/email.yml +++ /dev/null @@ -1,5 +0,0 @@ -release_date: ??? -rel_release_date: ??? -my_news_url: ??? -release_version: ??? -release_details: ???