Skip to content

Commit

Permalink
Malawi runs if you remove islands (roll-eyes)
Browse files Browse the repository at this point in the history
  • Loading branch information
athowes committed Nov 21, 2023
1 parent e4db3de commit 3995478
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/2_cv/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ run_ic <- function(survey, type, inf_function) {
}

ic_pars <- expand.grid("survey" = surveys, "inf_function" = fs)
ic <- purrr::pmap(ic_pars, safely(run_ic))
ic <- purrr::pmap(ic_pars, run_ic)

saveRDS(ic, file = "ic.rds")
1 change: 1 addition & 0 deletions src/2_plot_ladder/orderly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ artefacts:
description: Prevalence ladder plots
filenames:
- ladder-civ2017phia.png
- ladder-mwi2016phia.png
- ladder-tza2017phia.png
- ladder-zwe2016phia.png

Expand Down
6 changes: 3 additions & 3 deletions src/2_plot_ladder/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ ic <- readRDS("depends/ic_iid.rds")

lapply(ic, function(x) {

if(is.null(x$result)) return(NULL)
if(is.null(x)) return(NULL)

ggplot(x$result, aes(x = forcats::fct_reorder(area_name, mean), y = mean, ymin = lower, ymax = upper)) +
ggplot(x, aes(x = forcats::fct_reorder(area_name, mean), y = mean, ymin = lower, ymax = upper)) +
geom_pointrange(position = position_dodge(width = 0.6), alpha = 0.8) +
coord_flip() +
theme_minimal() +
scale_y_continuous(labels = scales::percent) +
labs(x = "Area name", y = "Prevalence estimate")

ggsave(paste0("ladder-", tolower(x$result$survey_id[1]), ".png"), h = 8, w = 6.25, bg = "white")
ggsave(paste0("ladder-", tolower(x$survey_id[1]), ".png"), h = 8, w = 6.25, bg = "white")
})
3 changes: 3 additions & 0 deletions src/2_process_surveys/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ surveys <- lapply(iso3, function(x) {
st_as_sf() %>%
st_transform(4326)

#' Remove the islands from Malawi
if(x == "mwi") sf <- filter(sf, !(area_name %in% c("Likoma", "Chizumulu")))

st_write(sf, paste0(tolower(survey_name[toupper(x)]), ".geojson"))

return(sf)
Expand Down

0 comments on commit 3995478

Please sign in to comment.