1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-10 03:42:03 +02:00

(v2.1.1.9143) unit tests

This commit is contained in:
2025-02-07 19:18:55 +01:00
parent cc2bb151ab
commit 2171f05951
11 changed files with 17 additions and 10 deletions

View File

@ -138,12 +138,15 @@ globalVariables(c(
"atc_group1",
"atc_group2",
"base_ab",
"beta_posterior_1",
"beta_posterior_2",
"ci_max",
"ci_min",
"clinical_breakpoints",
"code",
"cols",
"count",
"coverage",
"data",
"disk",
"dosage",
@ -152,6 +155,7 @@ globalVariables(c(
"fullname",
"fullname_lower",
"g_species",
"gamma_posterior",
"genus",
"gr",
"group",
@ -166,6 +170,7 @@ globalVariables(c(
"language",
"lookup",
"lower",
"lower_ci",
"method",
"mic ",
"mic",
@ -197,9 +202,11 @@ globalVariables(c(
"species",
"syndromic_group",
"total",
"total_rows",
"txt",
"type",
"upper",
"upper_ci",
"uti_index",
"value",
"varname",

View File

@ -625,7 +625,7 @@ antibiogram.default <- function(x,
# simulate pathogen incidence
# = Dirichlet (Gamma) parameters
random_incidence <- runif(1, min = 0, max = 1)
random_incidence <- stats::runif(1, min = 0, max = 1)
simulated_incidence <- stats::qgamma(
p = random_incidence,
shape = priors$gamma_posterior,
@ -636,7 +636,7 @@ antibiogram.default <- function(x,
# simulate susceptibility
# = Beta parameters
random_susceptibity <- runif(1, min = 0, max = 1)
random_susceptibity <- stats::runif(1, min = 0, max = 1)
simulated_susceptibility <- stats::qbeta(
p = random_susceptibity,
shape1 = priors$beta_posterior_1,
@ -1009,7 +1009,7 @@ wisca <- function(x,
}
#' @export
#' @param wisca_model the outcome of [wisca()] or [antibiogram(..., wisca = TRUE)]
#' @param wisca_model the outcome of [wisca()] or [`antibiogram(..., wisca = TRUE)`][antibiogram()]
#' @rdname antibiogram
retrieve_wisca_parameters <- function(wisca_model, ...) {
stop_ifnot(isTRUE(attributes(wisca_model)$wisca), "This function only applies to WISCA models. Use `wisca()` or `antibiogram(..., wisca = TRUE)` to create a WISCA model.")