The following call:
p <- malariasimulation::get_parameters() |>
malariasimulation::set_epi_outputs(age_group = c(0, 100, 200))
Produces the following warning:
Warning message:
In any(lapply(list(n_with_hypnozoites, iaa, iam, hypnozoites), is.null)) :
coercing argument of type 'list' to logical
Tracing this through it appears to be that the following section in set_epi_outputs() isn't happy:
if (parameters$parasite == "falciparum") {
if (!any(lapply(list(n_with_hypnozoites, iaa, iam, hypnozoites),
is.null))) {
stop("Some selected epi outputs do not apply to this parasite.")
}
}
Distilling it down I get the following simple example and possible fix
# Reprex of warning
bad_list <- list(
a = NULL,
b = NULL
)
!any(lapply(bad_list, is.null))
# Possible fix
list <- list(
a = NULL,
b = NULL
)
!any(sapply(bad_list, is.null))
@RJSheppard Maybe you could have a look as I think this is a modification that has come in with the pv changes?
The following call:
Produces the following warning:
Tracing this through it appears to be that the following section in
set_epi_outputs()isn't happy:Distilling it down I get the following simple example and possible fix
@RJSheppard Maybe you could have a look as I think this is a modification that has come in with the pv changes?