-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME.Rmd
144 lines (121 loc) · 6.55 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# GeoMSNA2022
<!-- badges: start -->
<!-- badges: end -->
The goal of GeoMSNA2022 is to facilitate geospatial and remote sensing analyses of selected global `MSNA`s.
Prior to the creation of this repository various RS variables have been extracted for 6 MSNA data sets (SOM, IRQ, COL, NER, NGA, and HTI). The extraction process is currently performed and documented in the `surveyGEER` package repository. Now that the variables have been extracted we aim to explore relationships between environmental/climatic/geospatial phenomena and household conditions.
It is recommended the country-offices with R-capacity use this repository to host this stage of analysis.
## Recommendations
- We recommend starting with Exploratory Data Analysis (EDA) using rmarkdown notebooks. You can simply run `usethis::use_vignettes()` to automatically create a markdown notebook
- Once exploratory data analysis has been performed the analyst should be sure to use weights for final analysis
## First Steps
You will need to decide on the variables in the HH data set that should be analyzed though a geospatial/climatic/environmental lens. Once you have done this you will find a rudimentary function called `load_core_hh_indicators.R` in the `R/` directory of this project. You can then add them to the function following the lead the `irq` team has provided. If you have the same variables as another country make sure you copy there label to use in your list.
```{r, eval =F}
load_core_hh_indicators <- function(input_df, country_code="irq"){
if (country_code=="irq"){
res <- list(
# labels on left - column names on right
`Food Consumption Score (numeric)`= "fcs",
`Food Consumption Score (categorical)`= "fcs_category",
`Household Hunger Scale (categorical)` = "household_hunger_scale",
`main source of food (categorical)` = "food_source",
`HHH unemployed (categorical)` = "unemployed_seek_work",
`HH debt (numeric)` = "how_much_debt",
`debt per member > 90k (categorical)` = "g37"
)
}
if(country_code=="som"){
res <- list(
`Respondent Gender` = "respondent_gender",
`Respondent Age` = "respondent_age",
`Region` = "region",
`District` = "district",
`Reside in an IDP settlement` = "idp_settlement",
`Village/settlement/IDP site` = "settlements",
`Household Size` = "hh_size",
`Household's total cash income from all income sources` = "total_house_income",
`If yes, what is yoour household's current total amount of debt in USD` = "total_hh_debt",
`Drinking` = "drinking_water",
`Cooking` = "cooking_water",
`Personal hygiene (washing or bathing)` = "hygiene_water",
`Other domestic purposes (cleaning house, floor, etc.)` = "domestice_water",
`FSL shocks Unusually high food prices` = "hh_fsl_shocks/high_food_prices",
`FSL shocks Drought/irregular rains, prolonged dry spell` = "hh_fsl_shocks/drought",
`FSL shocks Unusually high level of crop pests and disease` = "hh_fsl_shocks/crop_disease",
`FSL shocks Disease outbreak in the settlement` = "hh_fsl_shocks/disease_outbreak",
`FSL shocks Too much rain, flooding` = "hh_fsl_shocks/flooding",
`FSL shocks Livestock disease outbreak` = "hh_fsl_shocks/livestock_disease",
`No food to eat of any kind in your house because of lack of resources to get food` = "hh_no_food",
`How often did this happen in the past [4 weeks/30 days]` = "hh_no_food_freq",
`Go to sleep at night hungry because there was not enough food` = "hh_hunger",
`How often did this happen in the past [4 weeks/30 days]` = "hh_hunger_freq",
`Go a whole day and night without eating anything at all because there was not enough food` = "fs_not_enough_food",
`Livestock decrease Disease outbreak` = "reason_livestock_decrease/disease_outbreak",
`Livestock decrease Flooding` = "reason_livestock_decrease/flooding_flooding",
`Livestock decrease Drought` = "reason_livestock_decrease/drought_drought",
`Recent displacement Flooding (riverine and flash flood)` = "factors_recent_displacement/flooding",
`Recent displacement Drought (lack of food, water, livestock loss)` = "factors_recent_displacement/drought",
`Recent displacement Desert locust invasion` = "factors_recent_displacement/desert_locust",
`Have access to your current shelter in the next 6 months` = "shelter_access",
`Latitude` = "Lat",
`Longitude` = "Lon",
`uuid` = "uuid"
)
}
if(country_code=="nga"){
res <- list(
`State` = "state",
`Population Group` = "pop_group",
`Gender HoH` = "gender_hoh",
`Age HoH` = "age_hoh",
`Household size` = "hh_size",
`Income estimate` = "overall_income_estimate",
`Own livelihood assets` = "own_asset_hh",
`Amount debt` = "amount_of_debt",
`Own production` = "prim_source_of_food/own_prod",
`Shock Drought` = "diff_or_shocks/drought",
`Shock Flooding` = "diff_or_shocks/too_much_rain",
`Own farm animal` = "hoh_own_farm_animal",
`Land access` = "land_access_for_cultivation",
`Food unavailable` = "food_of_anykind",
`Food received` = "assistance_received_yn/food",
`Main HH need` = "hh_first_priority_need",
`Flooding Incident` = "nature_safety_incident/flooding",
`Livestock decrease (rain)` = "hoh_livestock_decrease/drought",
`Humanitarian assistance Flood` = "barriers_humanitarian_assistance/yes_poor",
`Cash LSG` = "cash_lsg",
`Lack income coping` = "cash_crit_ind",
`Food LSG` = "food_lsg",
`Not enough food` = "food_crit_ind1",
`Shock regarding food` = "food_crit_ind2",
`Health LSG` = "health_lsg",
`Access health care` = "health_crit_ind1",
`Challenges health care` = "health_crit_ind2",
`WASH LSG` = "wash_lsg",
`WASH water source` = "wash_crit_ind1",
`WASH enough water` = "wash_crit_ind3",
`Shelter LSG` = "shelter_lsg",
`Shelter damage and enclosure issues` = "shelter_crit_ind",
`Protection LSG` = "protection_lsg",
`Education LSG` = "education_lsg",
`MSNI` = "msni"
)
}
# select the given columns on the fetched msna dataset
df_msna_cols <- input_df |>
select(any_of(purrr::map_chr(res, ~.x)), starts_with("rs_")) |>
mutate(country_code = country_code)
return(df_msna_cols)
}
```