From 78b56709081818c05949565d7c29d8a29cec5dad Mon Sep 17 00:00:00 2001 From: AbrahamAz Date: Thu, 24 Oct 2024 12:25:26 +0200 Subject: [PATCH 1/2] renvlocks and readme --- README.Rmd | 1 - README.md | 1 - inst/fsl_cleaning/renv.lock | 4 ++-- inst/fsl_descriptive_analysis/renv.lock | 4 ++-- inst/fsl_quality_report/renv.lock | 4 ++-- inst/iphra_analysis/renv.lock | 4 ++-- inst/iphra_cleaning/renv.lock | 4 ++-- inst/iycf_cleaning/renv.lock | 4 ++-- inst/iycf_descriptive_analysis/renv.lock | 4 ++-- inst/iycf_quality_report/renv.lock | 4 ++-- inst/mort_cleaning/renv.lock | 4 ++-- inst/mort_descriptive_analysis/renv.lock | 4 ++-- inst/mort_quality_report/renv.lock | 4 ++-- inst/ph_integrated_tables/renv.lock | 4 ++-- 14 files changed, 24 insertions(+), 26 deletions(-) diff --git a/README.Rmd b/README.Rmd index fb67be2..04dc3cf 100644 --- a/README.Rmd +++ b/README.Rmd @@ -1184,7 +1184,6 @@ After running all the line in the run_ph_integrated_tables.R, below are the set >`Healthcare is Needed Column` <- Healthcare is Needed Column
>`Healthcare is Received Column` <- Healthcare is Received Column
>`Individual Age Column` <- Individual Age Column
- >`Individual Age Column` <- Individual Age Column
>`HH UUID Health Loop column` <- Household unique identifier in health members individual sheet(usually _submission__uuid)
>`HH UUID Main Sheet column` <- Household unique identifier in main household sheet(usually _uuid)
>`Nutrition Sheet` <- Nutrition Individual Sheet
diff --git a/README.md b/README.md index f592134..58692e4 100644 --- a/README.md +++ b/README.md @@ -1721,7 +1721,6 @@ Details > `Healthcare is Needed Column` \<- Healthcare is Needed Column
> `Healthcare is Received Column` \<- Healthcare is Received Column
> `Individual Age Column` \<- Individual Age Column
-> `Individual Age Column` \<- Individual Age Column
> `HH UUID Health Loop column` \<- Household unique identifier in health > members individual sheet(usually \_submission\_\_uuid)
> `HH UUID Main Sheet column` \<- Household unique identifier in main diff --git a/inst/fsl_cleaning/renv.lock b/inst/fsl_cleaning/renv.lock index 1c795a3..1cf7465 100644 --- a/inst/fsl_cleaning/renv.lock +++ b/inst/fsl_cleaning/renv.lock @@ -990,7 +990,7 @@ "RemoteHost": "api.github.com", "RemoteRepo": "impactR4PHU", "RemoteUsername": "impact-initiatives", - "RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768", + "RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6", "Requirements": [ "GGally", "R", @@ -1011,7 +1011,7 @@ "writexl", "zscorer" ], - "Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36" + "Hash": "0bdd86fcdc1313767413a2fb44ad6c42" }, "isoband": { "Package": "isoband", diff --git a/inst/fsl_descriptive_analysis/renv.lock b/inst/fsl_descriptive_analysis/renv.lock index 9d057b2..888f1cc 100644 --- a/inst/fsl_descriptive_analysis/renv.lock +++ b/inst/fsl_descriptive_analysis/renv.lock @@ -1148,7 +1148,7 @@ "RemoteHost": "api.github.com", "RemoteRepo": "impactR4PHU", "RemoteUsername": "impact-initiatives", - "RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768", + "RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6", "Requirements": [ "GGally", "R", @@ -1169,7 +1169,7 @@ "writexl", "zscorer" ], - "Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36" + "Hash": "0bdd86fcdc1313767413a2fb44ad6c42" }, "isoband": { "Package": "isoband", diff --git a/inst/fsl_quality_report/renv.lock b/inst/fsl_quality_report/renv.lock index 1c795a3..1cf7465 100644 --- a/inst/fsl_quality_report/renv.lock +++ b/inst/fsl_quality_report/renv.lock @@ -990,7 +990,7 @@ "RemoteHost": "api.github.com", "RemoteRepo": "impactR4PHU", "RemoteUsername": "impact-initiatives", - "RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768", + "RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6", "Requirements": [ "GGally", "R", @@ -1011,7 +1011,7 @@ "writexl", "zscorer" ], - "Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36" + "Hash": "0bdd86fcdc1313767413a2fb44ad6c42" }, "isoband": { "Package": "isoband", diff --git a/inst/iphra_analysis/renv.lock b/inst/iphra_analysis/renv.lock index 5fd8865..33e9341 100644 --- a/inst/iphra_analysis/renv.lock +++ b/inst/iphra_analysis/renv.lock @@ -799,7 +799,7 @@ "RemoteHost": "api.github.com", "RemoteRepo": "impactR4PHU", "RemoteUsername": "impact-initiatives", - "RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768", + "RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6", "Requirements": [ "GGally", "R", @@ -820,7 +820,7 @@ "writexl", "zscorer" ], - "Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36" + "Hash": "0bdd86fcdc1313767413a2fb44ad6c42" }, "isoband": { "Package": "isoband", diff --git a/inst/iphra_cleaning/renv.lock b/inst/iphra_cleaning/renv.lock index 62b30cb..514d0cd 100644 --- a/inst/iphra_cleaning/renv.lock +++ b/inst/iphra_cleaning/renv.lock @@ -875,7 +875,7 @@ "RemoteHost": "api.github.com", "RemoteRepo": "impactR4PHU", "RemoteUsername": "impact-initiatives", - "RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768", + "RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6", "Requirements": [ "GGally", "R", @@ -896,7 +896,7 @@ "writexl", "zscorer" ], - "Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36" + "Hash": "0bdd86fcdc1313767413a2fb44ad6c42" }, "isoband": { "Package": "isoband", diff --git a/inst/iycf_cleaning/renv.lock b/inst/iycf_cleaning/renv.lock index 1c795a3..1cf7465 100644 --- a/inst/iycf_cleaning/renv.lock +++ b/inst/iycf_cleaning/renv.lock @@ -990,7 +990,7 @@ "RemoteHost": "api.github.com", "RemoteRepo": "impactR4PHU", "RemoteUsername": "impact-initiatives", - "RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768", + "RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6", "Requirements": [ "GGally", "R", @@ -1011,7 +1011,7 @@ "writexl", "zscorer" ], - "Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36" + "Hash": "0bdd86fcdc1313767413a2fb44ad6c42" }, "isoband": { "Package": "isoband", diff --git a/inst/iycf_descriptive_analysis/renv.lock b/inst/iycf_descriptive_analysis/renv.lock index 53bca5b..f964a5c 100644 --- a/inst/iycf_descriptive_analysis/renv.lock +++ b/inst/iycf_descriptive_analysis/renv.lock @@ -1055,7 +1055,7 @@ "RemoteHost": "api.github.com", "RemoteRepo": "impactR4PHU", "RemoteUsername": "impact-initiatives", - "RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768", + "RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6", "Requirements": [ "GGally", "R", @@ -1076,7 +1076,7 @@ "writexl", "zscorer" ], - "Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36" + "Hash": "0bdd86fcdc1313767413a2fb44ad6c42" }, "isoband": { "Package": "isoband", diff --git a/inst/iycf_quality_report/renv.lock b/inst/iycf_quality_report/renv.lock index 3307a52..543f44a 100644 --- a/inst/iycf_quality_report/renv.lock +++ b/inst/iycf_quality_report/renv.lock @@ -923,7 +923,7 @@ "RemoteHost": "api.github.com", "RemoteRepo": "impactR4PHU", "RemoteUsername": "impact-initiatives", - "RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768", + "RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6", "Requirements": [ "GGally", "R", @@ -944,7 +944,7 @@ "writexl", "zscorer" ], - "Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36" + "Hash": "0bdd86fcdc1313767413a2fb44ad6c42" }, "isoband": { "Package": "isoband", diff --git a/inst/mort_cleaning/renv.lock b/inst/mort_cleaning/renv.lock index 1c795a3..1cf7465 100644 --- a/inst/mort_cleaning/renv.lock +++ b/inst/mort_cleaning/renv.lock @@ -990,7 +990,7 @@ "RemoteHost": "api.github.com", "RemoteRepo": "impactR4PHU", "RemoteUsername": "impact-initiatives", - "RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768", + "RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6", "Requirements": [ "GGally", "R", @@ -1011,7 +1011,7 @@ "writexl", "zscorer" ], - "Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36" + "Hash": "0bdd86fcdc1313767413a2fb44ad6c42" }, "isoband": { "Package": "isoband", diff --git a/inst/mort_descriptive_analysis/renv.lock b/inst/mort_descriptive_analysis/renv.lock index 53bca5b..f964a5c 100644 --- a/inst/mort_descriptive_analysis/renv.lock +++ b/inst/mort_descriptive_analysis/renv.lock @@ -1055,7 +1055,7 @@ "RemoteHost": "api.github.com", "RemoteRepo": "impactR4PHU", "RemoteUsername": "impact-initiatives", - "RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768", + "RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6", "Requirements": [ "GGally", "R", @@ -1076,7 +1076,7 @@ "writexl", "zscorer" ], - "Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36" + "Hash": "0bdd86fcdc1313767413a2fb44ad6c42" }, "isoband": { "Package": "isoband", diff --git a/inst/mort_quality_report/renv.lock b/inst/mort_quality_report/renv.lock index 1c795a3..1cf7465 100644 --- a/inst/mort_quality_report/renv.lock +++ b/inst/mort_quality_report/renv.lock @@ -990,7 +990,7 @@ "RemoteHost": "api.github.com", "RemoteRepo": "impactR4PHU", "RemoteUsername": "impact-initiatives", - "RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768", + "RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6", "Requirements": [ "GGally", "R", @@ -1011,7 +1011,7 @@ "writexl", "zscorer" ], - "Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36" + "Hash": "0bdd86fcdc1313767413a2fb44ad6c42" }, "isoband": { "Package": "isoband", diff --git a/inst/ph_integrated_tables/renv.lock b/inst/ph_integrated_tables/renv.lock index b63b8ea..3880a26 100644 --- a/inst/ph_integrated_tables/renv.lock +++ b/inst/ph_integrated_tables/renv.lock @@ -1158,7 +1158,7 @@ "RemoteHost": "api.github.com", "RemoteRepo": "impactR4PHU", "RemoteUsername": "impact-initiatives", - "RemoteSha": "29a5ad74a7b7c1692b665c771a0b9aedb47d5768", + "RemoteSha": "593547dfab2be707bfdd21031d514963b1f5dda6", "Requirements": [ "GGally", "R", @@ -1179,7 +1179,7 @@ "writexl", "zscorer" ], - "Hash": "d489b46c6f3c07f2f5c1fe4fabd58c36" + "Hash": "0bdd86fcdc1313767413a2fb44ad6c42" }, "isoband": { "Package": "isoband", From 6ac69775c54afdf69415392c402d14c32d5cc3c1 Mon Sep 17 00:00:00 2001 From: AbrahamAz Date: Thu, 24 Oct 2024 12:39:43 +0200 Subject: [PATCH 2/2] anticipation of changes on humind --- .../run_ph_integrated_tables.R | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/inst/ph_integrated_tables/run_ph_integrated_tables.R b/inst/ph_integrated_tables/run_ph_integrated_tables.R index 6684a50..65fb0a5 100644 --- a/inst/ph_integrated_tables/run_ph_integrated_tables.R +++ b/inst/ph_integrated_tables/run_ph_integrated_tables.R @@ -1521,9 +1521,19 @@ if(!file.exists("inputs/environment.Rdata")) { } else if (length(ind_healthcare_needed) == 0) { ind_healthcare_needed <- svDialogs::dlg_input(message= "Enter the name of the healthcare is needed","health_ind_healthcare_needed")$res } + + ## To comment out line 1527 and 1528 (In case new version humind change the levels) + ind_healthcare_needed_levels <- unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_needed])) ind_healthcare_needed_levels <- ind_healthcare_needed_levels[!is.na(ind_healthcare_needed_levels)] + ## To uncomment out line 1532, 1533, and 1534 (In case new version humind change the levels) + + # ind_healthcare_needed_yes <- tcltk::tk_select.list(unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_needed])), title = "Yes Value") + # ind_healthcare_needed_no <- tcltk::tk_select.list(unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_needed])), title = "No Value") + # ind_healthcare_needed_undefined <- tcltk::tk_select.list(unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_needed])), title = "Undefined Value", multiple =T) + + ## healthcare is needed ind_healthcare_received <- names(data.list[[healthcare_sheet]])[grepl("healthcare_received",names(data.list[[healthcare_sheet]]))] if(length(ind_healthcare_received) == 1){ @@ -1539,9 +1549,19 @@ if(!file.exists("inputs/environment.Rdata")) { } else if (length(ind_healthcare_received) == 0) { ind_healthcare_received <- svDialogs::dlg_input(message= "Enter the name of the healthcare is received","health_ind_healthcare_received")$res } + + ## To comment out line 1555 and 1556 (In case new version humind change the levels) + ind_healthcare_received_levels <- unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_received])) ind_healthcare_received_levels <- ind_healthcare_received_levels[!is.na(ind_healthcare_received_levels)] ## ind age + + ## To uncomment out line 1561, 1562, and 1563 (In case new version humind change the levels) + + # ind_healthcare_received_yes <- tcltk::tk_select.list(unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_received])), title = "Yes Value") + # ind_healthcare_received_no <- tcltk::tk_select.list(unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_received])), title = "No Value") + # ind_healthcare_received_undefined <- tcltk::tk_select.list(unique(unlist(data.list[[healthcare_sheet]][,ind_healthcare_received])), title = "Undefined Value", multiple =T) + ind_age <- names(data.list[[healthcare_sheet]])[grepl("ind_age",names(data.list[[healthcare_sheet]]))] if(length(ind_age) == 1){ yes_no <- svDialogs::dlg_message(paste0("Is '", ind_age, "' the correct column for age of individual?"), type = "yesno")$res @@ -1590,6 +1610,8 @@ if(!file.exists("inputs/environment.Rdata")) { } } +## To comment out line 1615 to 1627 (In case new version humind change the levels) + unmet_loop_df <- data.list[[healthcare_sheet]] %>% humind::add_loop_healthcare_needed_cat(ind_healthcare_needed = ind_healthcare_needed, ind_healthcare_needed_levels = ind_healthcare_needed_levels, @@ -1604,6 +1626,28 @@ unmet_loop_df <- data.list[[healthcare_sheet]] %>% unmet_healthcare = sum/n) %>% dplyr::select(admin1,unmet_healthcare) +## To uncomment out line 1631 to 1647 (In case new version humind change the levels) + +# unmet_loop_df <- data.list[[healthcare_sheet]] %>% +# humind::add_loop_healthcare_needed_cat(ind_healthcare_needed = ind_healthcare_needed, +# ind_healthcare_needed_yes = ind_healthcare_needed_yes, +# ind_healthcare_needed_no = ind_healthcare_needed_no, +# ind_healthcare_needed_undefined = ind_healthcare_needed_undefined, +# ind_healthcare_received = ind_healthcare_received, +# ind_healthcare_received_yes = ind_healthcare_received_yes, +# ind_healthcare_received_no = ind_healthcare_received_no, +# ind_healthcare_received_undefined = ind_healthcare_received_undefined, +# ind_age = ind_age) %>% +# srvyr::as_survey_design(weights = weight) %>% +# dplyr::mutate(admin1 = !!rlang::sym(admin1)) %>% +# dplyr::group_by(admin1) %>% +# dplyr::summarise(n = n(), +# sum = srvyr::survey_total(health_ind_healthcare_needed_yes_unmet), +# unmet_healthcare = sum/n) %>% +# dplyr::select(admin1,unmet_healthcare) + +## To comment out line 1651 to 1663 (In case new version humind change the levels) + unmet_loop_df_national <- data.list[[healthcare_sheet]] %>% humind::add_loop_healthcare_needed_cat(ind_healthcare_needed = ind_healthcare_needed, ind_healthcare_needed_levels = ind_healthcare_needed_levels, @@ -1618,6 +1662,26 @@ unmet_loop_df_national <- data.list[[healthcare_sheet]] %>% unmet_healthcare = sum/n) %>% dplyr::select(admin1,unmet_healthcare) +## To uncomment out line 1667 to 1683 (In case new version humind change the levels) + +# unmet_loop_df_national <- data.list[[healthcare_sheet]] %>% +# humind::add_loop_healthcare_needed_cat(ind_healthcare_needed = ind_healthcare_needed, +# ind_healthcare_needed_yes = ind_healthcare_needed_yes, +# ind_healthcare_needed_no = ind_healthcare_needed_no, +# ind_healthcare_needed_undefined = ind_healthcare_needed_undefined, +# ind_healthcare_received = ind_healthcare_received, +# ind_healthcare_received_yes = ind_healthcare_received_yes, +# ind_healthcare_received_no = ind_healthcare_received_no, +# ind_healthcare_received_undefined = ind_healthcare_received_undefined, +# ind_age = ind_age) %>% +# srvyr::as_survey_design(weights = weight) %>% +# dplyr::mutate(admin1 = "national") %>% +# dplyr::group_by(admin1) %>% +# dplyr::summarise(n = n(), +# sum = srvyr::survey_total(health_ind_healthcare_needed_yes_unmet), +# unmet_healthcare = sum/n) %>% +# dplyr::select(admin1,unmet_healthcare) + ## Nutrition if(!file.exists("inputs/environment.Rdata")) {