Skip to content

Commit

Permalink
Minor name fixes to get the transition tests to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
mclements committed Jul 9, 2024
1 parent 76abe0c commit 6de26a0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion R/ctstm.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ indiv_ctstm_sim_disease <- function(trans_model, max_t = 100, max_age = 100,
c("disprog", "data.table", "data.frame"))
setattr(disprog, "size",
c(get_size(trans_model), n_states = nrow(trans_model$trans_mat),
n_trans = max(trans_model$trans_mat, na.rm = TRUE)))
n_transitions = max(trans_model$trans_mat, na.rm = TRUE)))
setattr(disprog, "absorbing", absorbing(trans_model$trans_mat))
return(disprog[, ])
}
Expand Down
2 changes: 1 addition & 1 deletion R/sim-general.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#'
#' The object also contains `size` and `absorbing` attributes.
#' The `size` attribute is a numeric vector with the elements `n_samples`,
#' `n_strategies`, `n_patients`, `n_states`, and `n_trans` denoting the number of samples,
#' `n_strategies`, `n_patients`, `n_states`, and `n_transitions` denoting the number of samples,
#' treatment strategies, patients, health states and transitions. The `absorbing` attribute
#' is a numeric vector containing the absorbing health states; i.e., the
#' health states that cannot be transitioned from. Operationally, an
Expand Down
2 changes: 1 addition & 1 deletion R/statevals.R
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ create_StateVals.stateval_tbl <- function(object, hesim_data = NULL, n = 1000,
} else{
time_intervals <- NULL
}
transp <- (method == "transitions")
transp <- (method == "transition")
tparams <- new_tparams_mean(value = mu,
n_samples = n,
strategy_id = tbl$strategy_id,
Expand Down
6 changes: 3 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ check_StateVals <- function(models, object,
z = "patients")
if (models[[i]]$method == "transition") {
if (object_name=="disprog") {
check_size(get_id_object(models[[i]])$n_trans,
expected_size[["n_trans"]],
check_size(get_id_object(models[[i]])$n_transitions,
expected_size[["n_transitions"]],
z = "transitions")
} else stop(paste0("Transition-specific 'StateVals' not available for object_name == '",
object_name,"'.")
object_name,"'."))
} else # method != "transition"
check_size(
get_id_object(models[[i]])$n_states,
Expand Down
4 changes: 2 additions & 2 deletions man/disprog.Rd

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

0 comments on commit 6de26a0

Please sign in to comment.