You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to eventually include all three vectors species in each site file, even if only two are represented in that setting with a proportion >0. The malariasimulation metapopulation model requires that each site have the same number of species. Not an urgent problem, just for this specific use. Here is my hacky way for now:
# pull in default vector species values from an example site
vectors <- site::single_site(foresite::"KEN", 1)$vector
vectors$prop <- rep(0, 3)
arabiensis <- vectors[1, 5:12]
funestus <- vectors[2, 5:12]
gambiae <- vectors[3, 5:12]
print(arabiensis); print(funestus); print(gambiae)
# pull in site to modify
site <- site::single_site(foresite::"ETH", 1)
print(site$vector) # only two species represented
if(!("arabiensis" %in% c(site$vectors$species))){
add_row <- slice_tail(site$vectors, n = 1)
add_row[, 5:12] <- arabiensis
site$vectors <- bind_rows(site$vectors, add_row)
}
if(!("funestus" %in% c(site$vectors$species))){
add_row <- slice_tail(site$vectors, n = 1)
add_row[, 5:12] <- funestus
site$vectors <- bind_rows(site$vectors, add_row)
}
if(!("gambiae" %in% c(site$vectors$species))){
add_row <- slice_tail(site$vectors, n = 1)
add_row[, 5:12] <- gambiae
site$vectors <- bind_rows(site$vectors, add_row)
}
print(site$vectors) # three species now represented
The text was updated successfully, but these errors were encountered:
It would be useful to eventually include all three vectors species in each site file, even if only two are represented in that setting with a proportion >0. The
malariasimulation
metapopulation model requires that each site have the same number of species. Not an urgent problem, just for this specific use. Here is my hacky way for now:The text was updated successfully, but these errors were encountered: