diff --git a/DESCRIPTION b/DESCRIPTION index d02b7a7d..12e7fadd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -56,4 +56,4 @@ Suggests: truncnorm VignetteBuilder: knitr Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 diff --git a/R/ctstm.R b/R/ctstm.R index 83349dbf..4f635003 100644 --- a/R/ctstm.R +++ b/R/ctstm.R @@ -383,7 +383,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..9d78f55c 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.} diff --git a/R/input_mats.R b/R/input_mats.R index 10ad614b..4778c987 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..bb15beff 100644 --- a/R/model-fits.R +++ b/R/model-fits.R @@ -82,15 +82,15 @@ 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 [`flexsurv::flexsurvreg`] +#' or [`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}}. +#' @param object An object of class [`flexsurv::flexsurvreg_list`]. +#' @param data The data frame used to fit each survival model in `object`. #' @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}. +#' The first element, "models", contains the survival models passed to `object`, and the second +#' element, "data" contains the data frame passed to `data`. #' @examples #' library("flexsurv") #' fit1 <- flexsurv::flexsurvreg(formula = Surv(endpoint1_time, endpoint1_status) ~ age, diff --git a/R/model_def.R b/R/model_def.R index 3202aef4..61c97c2f 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/tparams_transprobs.R b/R/tparams_transprobs.R index 3496d049..bdb6eb5e 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`), diff --git a/R/tpmatrix.R b/R/tpmatrix.R index 44077178..37c13887 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`), diff --git a/man/create_IndivCtstmTrans.Rd b/man/create_IndivCtstmTrans.Rd index 1789c2e4..dd7a472b 100644 --- a/man/create_IndivCtstmTrans.Rd +++ b/man/create_IndivCtstmTrans.Rd @@ -79,7 +79,7 @@ distribution. If \code{"none"}, then only point estimates are returned.} \code{transition_types} in \code{\link{IndivCtstmTrans}}.} } \value{ -Returns an \code{\link{R6Class}} object of class \code{\link{IndivCtstmTrans}}. +Returns an \code{\link[R6:R6Class]{R6::R6Class}} object of class \code{\link{IndivCtstmTrans}}. } \description{ A generic function for creating an object of class \code{\link{IndivCtstmTrans}}. diff --git a/man/create_trans_dt.Rd b/man/create_trans_dt.Rd index 73ea1c10..28dc6462 100644 --- a/man/create_trans_dt.Rd +++ b/man/create_trans_dt.Rd @@ -11,7 +11,7 @@ create_trans_dt(trans_mat) See \code{\link{IndivCtstmTrans}}.} } \value{ -Returns a \code{\link{data.table}} in tidy format with three columns: +Returns a \code{\link[data.table:data.table]{data.table::data.table}} in tidy format with three columns: \describe{ \item{transition_id}{Health state transition ID.} \item{from}{The starting health state.} diff --git a/man/hesim.Rd b/man/hesim.Rd index 1624297c..6bd5d20a 100644 --- a/man/hesim.Rd +++ b/man/hesim.Rd @@ -2,8 +2,8 @@ % Please edit documentation in R/hesim.R \docType{package} \name{hesim} -\alias{hesim} \alias{hesim-package} +\alias{hesim} \title{hesim: Health Economic Simulation Modeling and Decision Analysis} \description{ To learn more about \code{hesim} visit the \href{https://hesim-dev.github.io/hesim/}{website}. diff --git a/man/input_mats.Rd b/man/input_mats.Rd index bb3e035b..8727d01f 100644 --- a/man/input_mats.Rd +++ b/man/input_mats.Rd @@ -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 \code{\link[=flexsurvreg_list]{flexsurvreg_list()}}).} \item{...}{For \code{input_mats()}, arguments to pass to \code{\link[=id_attributes]{id_attributes()}}. For \code{print()}, -arguments to pass to \code{\link[=print.data.table]{print.data.table()}}.} +arguments to pass to \code{\link[data.table:print.data.table]{data.table::print.data.table()}}.} \item{x}{An \code{\link{input_mats}} object.} } @@ -28,7 +28,7 @@ for simulating a statistical model. Consists of (i) input matrices, \code{X}, an (ii) \link[=id_attributes]{metadata} used to index each matrix in \code{X}. Once created, an \code{input_mats} object can be converted -to a \code{\link{data.table}} with \code{as.data.table()}, which is a helpful way to check that +to a \code{\link[data.table:data.table]{data.table::data.table}} with \code{as.data.table()}, which is a helpful way to check that the object is as expected. The \code{print()} method summarizes the object and prints it to the console. diff --git a/man/partsurvfit.Rd b/man/partsurvfit.Rd index 4f9939e6..5c7b8f07 100644 --- a/man/partsurvfit.Rd +++ b/man/partsurvfit.Rd @@ -7,10 +7,9 @@ partsurvfit(object, data) } \arguments{ -\item{object}{An object of class \code{\link{flexsurvreg_list}}.} +\item{object}{An object of class \code{\link[flexsurv:flexsurvreg_list]{flexsurv::flexsurvreg_list}}.} -\item{data}{The data frame used to fit each survival model in \code{object}. -\code{\link{flexsurvreg}}.} +\item{data}{The data frame used to fit each survival model in \code{object}.} } \value{ Returns an object of class \code{partsurvfit}, which is a list containing two elements. @@ -19,7 +18,8 @@ element, "data" contains the data frame passed to \code{data}. } \description{ Create a partitioned survival regression object of class \code{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]{flexsurv::flexsurvreg}} +or \code{\link[flexsurv:flexsurvspline]{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. } diff --git a/man/plot_ceac.Rd b/man/plot_ceac.Rd index 7cf4a1d6..2ff1a5a7 100644 --- a/man/plot_ceac.Rd +++ b/man/plot_ceac.Rd @@ -24,7 +24,7 @@ See the output returned by \code{\link[=get_labels]{get_labels()}} for an exampl } \description{ Plot a cost-effectiveness curve from either the output of \code{\link[=cea]{cea()}} or -\code{\link[=cea_pw]{cea_pw()}} using \code{\link{ggplot2}}. The former compares all treatment strategies +\code{\link[=cea_pw]{cea_pw()}} using \code{\link[ggplot2:ggplot]{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 diff --git a/man/plot_ceaf.Rd b/man/plot_ceaf.Rd index a049e194..c0336e6f 100644 --- a/man/plot_ceaf.Rd +++ b/man/plot_ceaf.Rd @@ -19,7 +19,7 @@ A \code{ggplot} object. } \description{ Plot a cost-effectiveness acceptability frontier (CEAF) from the output of -\code{\link{cea}} using \code{\link{ggplot2}}. The CEAF plots the probability +\code{\link{cea}} using \code{\link[ggplot2:ggplot]{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. } diff --git a/man/plot_ceplane.Rd b/man/plot_ceplane.Rd index c07b5a8a..958c1d5e 100644 --- a/man/plot_ceplane.Rd +++ b/man/plot_ceplane.Rd @@ -20,7 +20,7 @@ See the output returned by \code{\link[=get_labels]{get_labels()}} for an exampl A \code{ggplot} object. } \description{ -Plot a cost-effectiveness plane from the output of \code{\link[=cea_pw]{cea_pw()}} using \code{\link{ggplot2}}. +Plot a cost-effectiveness plane from the output of \code{\link[=cea_pw]{cea_pw()}} using \code{\link[ggplot2:ggplot]{ggplot2::ggplot}}. Each point is a random draw of incremental costs (y-axis) and incremental QALYs (x-axis) from a probabilistic sensitivity analysis. } diff --git a/man/plot_evpi.Rd b/man/plot_evpi.Rd index dd275cdd..f27f221a 100644 --- a/man/plot_evpi.Rd +++ b/man/plot_evpi.Rd @@ -19,7 +19,7 @@ A \code{ggplot} object. } \description{ Plot the expected value of perfect information (EVPI) from the output of -\code{\link[=cea]{cea()}} using \code{\link{ggplot2}}. Intuitively, the EVPI provides an estimate of the +\code{\link[=cea]{cea()}} using \code{\link[ggplot2:ggplot]{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. } diff --git a/man/plugin.Rd b/man/plugin.Rd index 372a1892..9f0d879d 100644 --- a/man/plugin.Rd +++ b/man/plugin.Rd @@ -13,17 +13,17 @@ inlineCxxPlugin(...) Code to use the hesim package inline. Not directly called by the user. } \examples{ -library(Rcpp) -sourceCpp(code=" -// [[Rcpp::depends(hesim)]] -// [[Rcpp::depends(RcppArmadillo)]] -#include -// [[Rcpp::export]] -double test_inline_gengamma(double mu, double sigma, double Q) { - hesim::stats::gengamma gg(mu, sigma, Q); - return gg.random(); -}") -set.seed(12345) -test_inline_gengamma(1.0, 1.0, 1.0) + library(Rcpp) + sourceCpp(code=" + // [[Rcpp::depends(hesim)]] + // [[Rcpp::depends(RcppArmadillo)]] + #include + // [[Rcpp::export]] + double test_inline_gengamma(double mu, double sigma, double Q) { + hesim::stats::gengamma gg(mu, sigma, Q); + return gg.random(); + }") + set.seed(12345) + test_inline_gengamma(1.0, 1.0, 1.0) } \keyword{internal} diff --git a/man/summary.eval_rng.Rd b/man/summary.eval_rng.Rd index 802d426f..47894cc0 100644 --- a/man/summary.eval_rng.Rd +++ b/man/summary.eval_rng.Rd @@ -23,7 +23,7 @@ character string used to separate the terms.} \item{...}{For the print method, arguments to pass to \code{summary.eval_rng()}.} } \value{ -\code{summary.eval_rng()} returns a \code{\link{data.table}} with columns for +\code{summary.eval_rng()} returns a \code{\link[data.table:data,table]{data.table::data,table}} with columns for (i) the name of the parameter (\code{param}), (ii) the mean of the parameter samples (\code{mean}), (iii) the standard deviation of the parameter samples (\code{sd}), and (iv) quantiles of the parameter samples corresponding diff --git a/man/summary.params.Rd b/man/summary.params.Rd index 60652061..c7d0ca0e 100644 --- a/man/summary.params.Rd +++ b/man/summary.params.Rd @@ -30,7 +30,7 @@ computed.} \item{...}{Additional arguments affecting the summary. Currently unused.} } \value{ -A \code{\link{data.table}} that always contains the following columns: +A \code{\link[data.table:data.table]{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/man/summary.tparams_transprobs.Rd b/man/summary.tparams_transprobs.Rd index 88f7e7ba..377ff88d 100644 --- a/man/summary.tparams_transprobs.Rd +++ b/man/summary.tparams_transprobs.Rd @@ -23,7 +23,7 @@ vectors. See "Value" below for additional details.} \item{...}{Additional arguments affecting the summary. Currently unused.} } \value{ -If \code{unflatten = "FALSE"} (the default), then a \code{\link{data.table}} +If \code{unflatten = "FALSE"} (the default), then a \code{\link[data.table:data.table]{data.table::data.table}} is returned with columns for (i) the health state that is being transitioned from (\code{from}), (ii) the health state that is being transitioned to (\code{to}) (iii) the mean of each parameter across parameter samples (\code{mean}), diff --git a/man/summary.tpmatrix.Rd b/man/summary.tpmatrix.Rd index 92418f29..7f774c05 100644 --- a/man/summary.tpmatrix.Rd +++ b/man/summary.tpmatrix.Rd @@ -27,7 +27,7 @@ vectors. See "Value" below for additional details.} \item{...}{Additional arguments affecting the summary. Currently unused.} } \value{ -If \code{unflatten = "FALSE"} (the default), then a \code{\link{data.table}} +If \code{unflatten = "FALSE"} (the default), then a \code{\link[data.table:data.table]{data.table::data.table}} is returned with columns for (i) the health state that is being transitioned from (\code{from}), (ii) the health state that is being transitioned to (\code{to}) (iii) the mean of each parameter across parameter samples (\code{mean}),