Skip to content

Commit

Permalink
Merge pull request #128 from mclements/fix_cran_errors
Browse files Browse the repository at this point in the history
Fix cran errors
  • Loading branch information
dincerti authored Sep 14, 2024
2 parents e2f54a0 + fa014a8 commit ea370d1
Show file tree
Hide file tree
Showing 29 changed files with 56 additions and 53 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ vignettes/benchmarks*
^vignettes/README
^vignettes/precompile.R
^CRAN-SUBMISSION$
^Makefile$
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down Expand Up @@ -56,4 +56,4 @@ Suggests:
truncnorm
VignetteBuilder: knitr
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion R/ctstm.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions R/hesim_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.}
Expand Down Expand Up @@ -729,4 +729,4 @@ get_labels <- function(object, strategy = "strategy_name",

# Return
return(l)
}
}
4 changes: 2 additions & 2 deletions R/input_mats.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#'
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions R/model-fits.R
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand All @@ -112,4 +112,4 @@ partsurvfit <- function(object, data){
res <- list(models = object, data = data)
class(res) <- "partsurvfit"
return(res)
}
}
2 changes: 1 addition & 1 deletion R/model_def.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/params.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.}
Expand Down
8 changes: 4 additions & 4 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/statevals.R
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...){

Expand Down
4 changes: 2 additions & 2 deletions R/tparams_transprobs.R
Original file line number Diff line number Diff line change
Expand Up @@ -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`),
Expand Down Expand Up @@ -462,4 +462,4 @@ as.data.table.tparams_transprobs <- function(x, ..., prefix = "prob_", sep = "_"
setattr(x_dt, v, x[[v]])
}
x_dt[, ]
}
}
4 changes: 2 additions & 2 deletions R/tpmatrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -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`),
Expand Down Expand Up @@ -769,4 +769,4 @@ apply_rr <- function(x, rr, index, complement = NULL) {

# Run C function
C_apply_rr(x, rr, index - 1, complement - 1)
}
}
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -100,4 +100,4 @@ If you use `hesim`, please cite as follows:

```{r, echo = FALSE, comment = ""}
citation("hesim")
```
```
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Application
1
</td>
<td style="text-align:left;width: 15em; ">
<a href="https://arxiv.org/pdf/2102.09437.pdf" style=" ">Preprint
<a href="https://arxiv.org/pdf/2102.09437" style=" ">Preprint
4.1</a>
</td>
<td style="text-align:left;">
Expand All @@ -163,7 +163,7 @@ Oncology
2
</td>
<td style="text-align:left;width: 15em; ">
<a href="https://arxiv.org/pdf/2102.09437.pdf" style=" ">Preprint
<a href="https://arxiv.org/pdf/2102.09437" style=" ">Preprint
4.2</a>
</td>
<td style="text-align:left;">
Expand All @@ -190,7 +190,7 @@ Oncology
3
</td>
<td style="text-align:left;width: 15em; ">
<a href="https://arxiv.org/pdf/2102.09437.pdf" style=" ">Preprint
<a href="https://arxiv.org/pdf/2102.09437" style=" ">Preprint
4.3</a>
</td>
<td style="text-align:left;">
Expand Down
2 changes: 1 addition & 1 deletion man/create_IndivCtstmTrans.Rd

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

2 changes: 1 addition & 1 deletion man/create_trans_dt.Rd

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

2 changes: 1 addition & 1 deletion man/hesim.Rd

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

4 changes: 2 additions & 2 deletions man/input_mats.Rd

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

4 changes: 2 additions & 2 deletions man/partsurvfit.Rd

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

2 changes: 1 addition & 1 deletion man/plot_ceac.Rd

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

2 changes: 1 addition & 1 deletion man/plot_ceaf.Rd

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

2 changes: 1 addition & 1 deletion man/plot_ceplane.Rd

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

2 changes: 1 addition & 1 deletion man/plot_evpi.Rd

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

24 changes: 12 additions & 12 deletions man/plugin.Rd

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

2 changes: 1 addition & 1 deletion man/summary.eval_rng.Rd

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

2 changes: 1 addition & 1 deletion man/summary.params.Rd

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

2 changes: 1 addition & 1 deletion man/summary.tparams_transprobs.Rd

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

Loading

0 comments on commit ea370d1

Please sign in to comment.