diff --git a/R/tool.R b/R/tool.R index 8cf4f83c..d311891e 100644 --- a/R/tool.R +++ b/R/tool.R @@ -191,12 +191,12 @@ add_tool <- function(model, tool, proportion) { distfun = distribute_tool_randomly(proportion, TRUE) ) - } else if (attr(tool, "uses_deprecated")) { + } else if (isTRUE(attr(tool, "uses_deprecated"))) { set_distribution_tool( tool = tool, distfun = distribute_tool_randomly( - proportion = attr(tool, "deprecated_args")$prevalence, + prevalence = attr(tool, "deprecated_args")$prevalence, as_proportion = attr(tool, "deprecated_args")$as_proportion ) ) diff --git a/R/virus.R b/R/virus.R index a3576177..b93b13d4 100644 --- a/R/virus.R +++ b/R/virus.R @@ -191,12 +191,12 @@ add_virus <- function(model, virus, proportion) { distfun=distribute_virus_randomly(proportion, as_proportion = TRUE) ) - } else if (attr(tool, "uses_deprecated")) { + } else if (isTRUE(attr(tool, "uses_deprecated"))) { set_distribution_virus( virus = tool, distfun = distribute_virus_randomly( - proportion = attr(tool, "deprecated_args")$prevalence, + prevalence = attr(tool, "deprecated_args")$prevalence, as_proportion = attr(tool, "deprecated_args")$as_proportion ) )