diff --git a/.Rbuildignore b/.Rbuildignore index e8dae181..3cf63732 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -22,3 +22,4 @@ vignettes/benchmarks* ^vignettes/README ^vignettes/precompile.R ^CRAN-SUBMISSION$ +^Makefile$ diff --git a/DESCRIPTION b/DESCRIPTION index d02b7a7d..a12e6ea6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: hesim Type: Package Title: Health Economic Simulation Modeling and Decision Analysis -Version: 0.5.4 +Version: 0.5.5 Authors@R: c( person("Devin", "Incerti", , "devin.incerti@gmail.com", role = c("aut", "cre")), person("Jeroen P.", "Jansen", role = "aut"), @@ -56,4 +56,4 @@ Suggests: truncnorm VignetteBuilder: knitr Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 diff --git a/NAMESPACE b/NAMESPACE index f86f448a..898e0575 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -165,6 +165,7 @@ export(tpmatrix) export(tpmatrix_id) export(tpmatrix_names) import(data.table) +importFrom(R6,R6Class) importFrom(Rcpp,evalCpp) importFrom(data.table,as.data.table) importFrom(ggplot2,.data) diff --git a/R/ctstm.R b/R/ctstm.R index 83349dbf..44dc8ba6 100644 --- a/R/ctstm.R +++ b/R/ctstm.R @@ -7,6 +7,7 @@ #' both Markov and semi-Markov multi-state models and does not depend on the #' methodology used for prediction of state probabilities. #' @format An [`R6::R6Class`] object. +#' @importFrom R6 R6Class #' @seealso [`create_IndivCtstmTrans()`], [`IndivCtstmTrans`] #' @keywords internal #' @export @@ -383,7 +384,7 @@ IndivCtstmTrans <- R6::R6Class( #' `transition_types` in [`IndivCtstmTrans`]. #' @inheritParams create_CohortDtstmTrans #' @param ... Further arguments passed to `IndivCtstmTrans$new()` in [`IndivCtstmTrans`]. -#' @return Returns an [`R6Class`] object of class [`IndivCtstmTrans`]. +#' @return Returns an [`R6::R6Class`] object of class [`IndivCtstmTrans`]. #' @template details-create_disease_model #' @seealso See [`IndivCtstmTrans`] and [`IndivCtstm`] for examples. #' @name create_IndivCtstmTrans diff --git a/R/hesim_data.R b/R/hesim_data.R index 189fe795..2a0623c7 100644 --- a/R/hesim_data.R +++ b/R/hesim_data.R @@ -44,7 +44,7 @@ create_lines_dt <- function(strategy_list, strategy_ids = NULL){ #' the states and transitions in a multi-state model suitable for use with [`hesim_data`]. #' @param trans_mat A transition matrix in the format from the [`mstate`][mstate::mstate] package. #' See [`IndivCtstmTrans`]. -#' @return Returns a [`data.table`] in tidy format with three columns: +#' @return Returns a [`data.table::data.table`] in tidy format with three columns: #' \describe{ #' \item{transition_id}{Health state transition ID.} #' \item{from}{The starting health state.} @@ -729,4 +729,4 @@ get_labels <- function(object, strategy = "strategy_name", # Return return(l) -} \ No newline at end of file +} diff --git a/R/input_mats.R b/R/input_mats.R index 10ad614b..16b16cd8 100644 --- a/R/input_mats.R +++ b/R/input_mats.R @@ -7,7 +7,7 @@ #' (ii) [metadata][id_attributes()] used to index each matrix in `X`. #' #' Once created, an `input_mats` object can be converted -#' to a [`data.table`] with `as.data.table()`, which is a helpful way to check that +#' to a [`data.table::data.table`] with `as.data.table()`, which is a helpful way to check that #' the object is as expected. The `print()` method summarizes the object and #' prints it to the console. #' @@ -18,7 +18,7 @@ #' in a statistical model. May also be a list of lists of input matrices when a #' list of separate models is fit (e.g., with [flexsurvreg_list()]). #' @param ... For `input_mats()`, arguments to pass to [id_attributes()]. For `print()`, -#' arguments to pass to [print.data.table()]. +#' arguments to pass to [data.table::print.data.table()]. #' #' @details #' `input_mats` objects are used with [`params`] objects to simulate diff --git a/R/model-fits.R b/R/model-fits.R index 9d9c1750..4b8b0d79 100644 --- a/R/model-fits.R +++ b/R/model-fits.R @@ -82,12 +82,12 @@ multinom_list <- function(...){ #' Partitioned survival regression object #' #' Create a partitioned survival regression object of class `partsurvfit`. The object contains a list -#' of fitted survival models fit using either \code{\link{flexsurvreg}} or \code{\link{flexsurvspline}} (i.e., +#' of fitted survival models fit using either \code{\link[flexsurv]{flexsurvreg}} or \code{\link[flexsurv]{flexsurvspline}} (i.e., #' an object of class \code{\link{flexsurvreg_list}}) and the data frame used to perform the fit of each model. #' The same data frame must have been used for each fit. #' @param object An object of class \code{\link{flexsurvreg_list}}. #' @param data The data frame used to fit each survival model in \code{object}. -#' \code{\link{flexsurvreg}}. +#' \code{\link[flexsurv]{flexsurvreg}}. #' @return Returns an object of class `partsurvfit`, which is a list containing two elements. #' The first element, "models", contains the survival models passed to \code{object}, and the second #' element, "data" contains the data frame passed to \code{data}. @@ -112,4 +112,4 @@ partsurvfit <- function(object, data){ res <- list(models = object, data = data) class(res) <- "partsurvfit" return(res) -} \ No newline at end of file +} diff --git a/R/model_def.R b/R/model_def.R index 3202aef4..e4087194 100644 --- a/R/model_def.R +++ b/R/model_def.R @@ -123,7 +123,7 @@ c.eval_rng <- function(...) { #' character string used to separate the terms. #' @param ... For the print method, arguments to pass to `summary.eval_rng()`. #' -#' @return `summary.eval_rng()` returns a [`data.table`] with columns for +#' @return `summary.eval_rng()` returns a [`data.table::data.table`] with columns for #' (i) the name of the parameter (`param`), (ii) the mean of the parameter #' samples (`mean`), (iii) the standard deviation of the parameter samples (`sd`), #' and (iv) quantiles of the parameter samples corresponding diff --git a/R/params.R b/R/params.R index 46aa21ff..23384e74 100644 --- a/R/params.R +++ b/R/params.R @@ -22,7 +22,7 @@ NULL #' computed. #' @param ... Additional arguments affecting the summary. Currently unused. #' -#' @return A [`data.table`] that always contains the following columns: +#' @return A [`data.table::data.table`] that always contains the following columns: #' \describe{ #' \item{term}{The regression term.} #' \item{mean}{The mean value of the regression term.} diff --git a/R/plot.R b/R/plot.R index 67ee26a9..ddcc18f2 100644 --- a/R/plot.R +++ b/R/plot.R @@ -6,7 +6,7 @@ format_dollar <- function(x) { # Cost-effectiveness plane ----------------------------------------------------- #' Plot cost-effectiveness plane #' -#' Plot a cost-effectiveness plane from the output of [`cea_pw()`] using [`ggplot2`]. +#' Plot a cost-effectiveness plane from the output of [`cea_pw()`] using [`ggplot2::ggplot`]. #' Each point is a random draw of incremental costs (y-axis) and incremental QALYs (x-axis) #' from a probabilistic sensitivity analysis. #' @inheritParams set_labels @@ -69,7 +69,7 @@ plot_ceplane <- function(x, k = 50000, labels = NULL) { #' Plot cost-effectiveness acceptability curve #' #' Plot a cost-effectiveness curve from either the output of [`cea()`] or -#' [`cea_pw()`] using [`ggplot2`]. The former compares all treatment strategies +#' [`cea_pw()`] using [`ggplot2::ggplot`]. The former compares all treatment strategies #' simultaneously and uses the probabilistic sensitivity analysis (PSA) to compute #' the probability that each strategy is the most cost-effective at a given #' willingness to pay value, while the latter uses the PSA to compute the probability @@ -154,7 +154,7 @@ plot_ceac.cea <- function(x, labels = NULL, ...) { #' Plot cost-effectiveness acceptability frontier #' #' Plot a cost-effectiveness acceptability frontier (CEAF) from the output of -#' [`cea`] using [`ggplot2`]. The CEAF plots the probability +#' [`cea`] using [`ggplot2::ggplot`]. The CEAF plots the probability #' that the optimal treatment strategy (i.e., the strategy with the highest #' expected net monetary benefit) is cost-effective. #' @inheritParams set_labels @@ -172,7 +172,7 @@ plot_ceaf <- function(x, labels = NULL) { #' Plot expected value of perfect information #' #' Plot the expected value of perfect information (EVPI) from the output of -#' [`cea()`] using [`ggplot2`]. Intuitively, the EVPI provides an estimate of the +#' [`cea()`] using [`ggplot2::ggplot`]. Intuitively, the EVPI provides an estimate of the #' amount that a decision maker would be willing to pay to collect additional data #' and completely eliminate uncertainty. #' @inheritParams set_labels diff --git a/R/statevals.R b/R/statevals.R index 189c40b4..e9e043fc 100644 --- a/R/statevals.R +++ b/R/statevals.R @@ -361,7 +361,7 @@ create_StateVals.lm <- function(object, input_data = NULL, n = 1000, return(StateVals$new(params = params, input_data = input_mats, ...)) } -#' @rdname create_StateVals +#' @rdname create_StateVals #' @export create_StateVals.stateval_tbl <- function(object, hesim_data = NULL, n = 1000, ...){ diff --git a/R/tparams_transprobs.R b/R/tparams_transprobs.R index 3496d049..88fe5910 100644 --- a/R/tparams_transprobs.R +++ b/R/tparams_transprobs.R @@ -347,7 +347,7 @@ summarize_transprobs_dt <- function(x, probs, unflatten, #' @inheritParams summary.tpmatrix #' @param object A [`tparams_transprobs`] object. #' -#' @return If `unflatten = "FALSE"` (the default), then a [`data.table`] +#' @return If `unflatten = "FALSE"` (the default), then a [`data.table::data.table`] #' is returned with columns for (i) the health state that is being transitioned #' from (`from`), (ii) the health state that is being transitioned to (`to`) #' (iii) the mean of each parameter across parameter samples (`mean`), @@ -462,4 +462,4 @@ as.data.table.tparams_transprobs <- function(x, ..., prefix = "prob_", sep = "_" setattr(x_dt, v, x[[v]]) } x_dt[, ] -} \ No newline at end of file +} diff --git a/R/tpmatrix.R b/R/tpmatrix.R index 44077178..b6334e9b 100644 --- a/R/tpmatrix.R +++ b/R/tpmatrix.R @@ -339,7 +339,7 @@ tpmatrix <- function(..., complement = NULL, states = NULL, #' vectors. See "Value" below for additional details. #' @param ... Additional arguments affecting the summary. Currently unused. #' -#' @return If `unflatten = "FALSE"` (the default), then a [`data.table`] +#' @return If `unflatten = "FALSE"` (the default), then a [`data.table::data.table`] #' is returned with columns for (i) the health state that is being transitioned #' from (`from`), (ii) the health state that is being transitioned to (`to`) #' (iii) the mean of each parameter across parameter samples (`mean`), @@ -769,4 +769,4 @@ apply_rr <- function(x, rr, index, complement = NULL) { # Run C function C_apply_rr(x, rr, index - 1, complement - 1) -} \ No newline at end of file +} diff --git a/README.Rmd b/README.Rmd index a8be236c..5145887e 100644 --- a/README.Rmd +++ b/README.Rmd @@ -51,7 +51,7 @@ library("knitr") library("kableExtra") level <- c("Cohort", "Cohort", "Cohort", "Cohort", "Individual", "Individual", "Cohort") links <- c( - rep("https://arxiv.org/pdf/2102.09437.pdf", 3), + rep("https://arxiv.org/pdf/2102.09437", 3), "https://hesim-dev.github.io/hesim/articles/markov-cohort.html", "https://hesim-dev.github.io/hesim/articles/markov-inhomogeneous-cohort.html", "https://hesim-dev.github.io/hesim/articles/mlogit.html", @@ -100,4 +100,4 @@ If you use `hesim`, please cite as follows: ```{r, echo = FALSE, comment = ""} citation("hesim") -``` \ No newline at end of file +``` diff --git a/README.md b/README.md index b48beb85..f0644762 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ Application 1