Skip to contents

check_fsl_flags

Usage

check_fsl_flags(
  .dataset,
  fsl_fcs_cereal = "fsl_fcs_cereal",
  fsl_fcs_legumes = "fsl_fcs_legumes",
  fsl_fcs_dairy = "fsl_fcs_dairy",
  fsl_fcs_meat = "fsl_fcs_meat",
  fsl_fcs_veg = "fsl_fcs_veg",
  fsl_fcs_fruit = "fsl_fcs_fruit",
  fsl_fcs_oil = "fsl_fcs_oil",
  fsl_fcs_sugar = "fsl_fcs_sugar",
  fsl_rcsi_lessquality = "fsl_rcsi_lessquality",
  fsl_rcsi_borrow = "fsl_rcsi_borrow",
  fsl_rcsi_mealsize = "fsl_rcsi_mealsize",
  fsl_rcsi_mealadult = "fsl_rcsi_mealadult",
  fsl_rcsi_mealnb = "fsl_rcsi_mealnb",
  fsl_hhs_nofoodhh = "fsl_hhs_nofoodhh",
  fsl_hhs_nofoodhh_freq = "fsl_hhs_nofoodhh_freq",
  fsl_hhs_sleephungry = "fsl_hhs_sleephungry",
  fsl_hhs_sleephungry_freq = "fsl_hhs_sleephungry_freq",
  fsl_hhs_alldaynight = "fsl_hhs_alldaynight",
  fsl_hhs_alldaynight_freq = "fsl_hhs_alldaynight_freq",
  fsl_hdds_cereals = "fsl_hdds_cereals",
  fsl_hdds_tubers = "fsl_hdds_tubers",
  fsl_hdds_legumes = "fsl_hdds_legumes",
  fsl_hdds_veg = "fsl_hdds_veg",
  fsl_hdds_fruit = "fsl_hdds_fruit",
  fsl_hdds_meat = "fsl_hdds_meat",
  fsl_hdds_fish = "fsl_hdds_fish",
  fsl_hdds_dairy = "fsl_hdds_dairy",
  fsl_hdds_eggs = "fsl_hdds_eggs",
  fsl_hdds_sugar = "fsl_hdds_sugar",
  fsl_hdds_oil = "fsl_hdds_oil",
  fsl_hdds_condiments = "fsl_hdds_condiments",
  fsl_hdds_yes_value = "yes",
  fsl_lcsi_stress1 = "fsl_lcsi_stress1",
  fsl_lcsi_stress2 = "fsl_lcsi_stress2",
  fsl_lcsi_stress3 = "fsl_lcsi_stress3",
  fsl_lcsi_stress4 = "fsl_lcsi_stress4",
  fsl_lcsi_crisis1 = "fsl_lcsi_crisis1",
  fsl_lcsi_crisis2 = "fsl_lcsi_crisis2",
  fsl_lcsi_crisis3 = "fsl_lcsi_crisis3",
  fsl_lcsi_emergency1 = "fsl_lcsi_emergency1",
  fsl_lcsi_emergency2 = "fsl_lcsi_emergency2",
  fsl_lcsi_emergency3 = "fsl_lcsi_emergency3",
  fsl_lcsi_stress = "fsl_lcsi_stress",
  fsl_lcsi_crisis = "fsl_lcsi_crisis",
  fsl_lcsi_emergency = "fsl_lcsi_emergency",
  fsl_lcsi_cat_yes = "fsl_lcsi_cat_yes",
  fsl_lcsi_cat_exhaust = "fsl_lcsi_cat_exhaust",
  fsl_lcsi_cat = "fsl_lcsi_cat",
  fsl_lcsi_yes_value = "yes",
  fsl_fcs_cat = "fsl_fcs_cat",
  fsl_fcs_score = "fsl_fcs_score",
  fsl_rcsi_cat = "fsl_rcsi_cat",
  fsl_rcsi_score = "fsl_rcsi_score",
  fsl_hhs_cat = "fsl_hhs_cat",
  fsl_hhs_score = "fsl_hhs_score",
  fsl_hdds_cat = "fsl_hdds_cat",
  fsl_hdds_score = "fsl_hdds_score",
  fsl_fc_cell = "fsl_fc_cell",
  fsl_fc_phase = "fsl_fc_phase",
  num_children = "num_children",
  income_types = c("fsl_first_income_types", "fsl_second_income_types",
    "fsl_third_income_types"),
  sell_agri_prod = "sell_agri_prod",
  sell_anim_prod = "sell_anim_prod",
  residency_status = "residency_status",
  value_idp = "idp",
  tool.survey = NULL,
  label_colname = "label::English",
  uuid = "uuid"
)

Arguments

.dataset

the raw dataset with all add_x indicators functions called in

fsl_fcs_cereal

the name of the variable that indicates the number of days cereals were consumed

fsl_fcs_legumes

the name of the variable that indicates the number of days legumes were consumed

fsl_fcs_dairy

the name of the variable that indicates the number of days dairy were consumed

fsl_fcs_meat

the name of the variable that indicates the number of days meat were consumed

fsl_fcs_veg

the name of the variable that indicates the number of days vegetables were consumed

fsl_fcs_fruit

the name of the variable that indicates the number of days fruit were consumed

fsl_fcs_oil

the name of the variable that indicates the number of days oil was consumed

fsl_fcs_sugar

the name of the variable that indicates the number of days sugar was consumed

fsl_rcsi_lessquality

Column representing question- During the last 7 days, were there days (and, if so, how many) when your household had to rely on less preferred and less expensive food to cope with a lack of food or money to buy it?

fsl_rcsi_borrow

Column representing question- During the last 7 days, were there days (and, if so, how many) when your household had to borrow food or rely on help from a relative or friend to cope with a lack of food or money to buy it?

fsl_rcsi_mealsize

Column representing question- During the last 7 days, were there days (and, if so, how many) when your household had to limit portion size of meals at meal times to cope with a lack of food or money to buy it?

fsl_rcsi_mealadult

Column representing question- During the last 7 days, were there days (and, if so, how many) when your household had to restrict consumption by adults in order for small children to eat to cope with a lack of food or money to buy it?

fsl_rcsi_mealnb

Column representing question - During the last 7 days, were there days (and, if so, how many) when your household had to reduce number of meals eaten in a day to cope with a lack of food or money to buy it?

fsl_hhs_nofoodhh

The name of the column "In the past 4 weeks (30 days), was there ever no food to eat of any kind in your house because of lack of resources to get food?". It has to be a string.

fsl_hhs_nofoodhh_freq

The name of the column "How often did this happen in the past (4 weeks/30 days)?". It has to be a string.

fsl_hhs_sleephungry

The name of the column "In the past 4 weeks (30 days), did you or any household member go to sleep at night hungry because there was not enough food?". It has to be a string.

fsl_hhs_sleephungry_freq

The name of the column "How often did this happen in the past (4 weeks/30 days)?". It has to be a string.

fsl_hhs_alldaynight

The name of the column "In the past 4 weeks (30 days), did you or any household member go a whole day and night without eating anything at all because there was not enough food?". It has to be a string.

fsl_hhs_alldaynight_freq

The name of the column "How often did this happen in the past (4 weeks/30 days)?". It has to be a string.

fsl_hdds_cereals

the name of the variable that indicates if cereals were consumed in the last 24 hours

fsl_hdds_tubers

the name of the variable that indicates if roots or tubers were consumed in the last 24 hours

fsl_hdds_legumes

the name of the variable that indicates if pulses or legumes were consumed in the last 24 hours

fsl_hdds_veg

the name of the variable that indicates if vegetables were consumed in the last 24 hours

fsl_hdds_fruit

the name of the variable that indicates if fruit were consumed in the last 24 hours

fsl_hdds_meat

the name of the variable that indicates if meat were consumed in the last 24 hours

fsl_hdds_fish

the name of the variable that indicates if fish were consumed in the last 24 hours

fsl_hdds_dairy

the name of the variable that indicates if dairy were consumed in the last 24 hours

fsl_hdds_eggs

the name of the variable that indicates if eggs were consumed in the last 24 hours

fsl_hdds_sugar

the name of the variable that indicates if sugar were consumed in the last 24 hours

fsl_hdds_oil

the name of the variable that indicates if oil was consumed in the last 24 hours

fsl_hdds_condiments

the name of the variable that indicates if condiments were consumed in the last 24 hours

fsl_hdds_yes_value

the "yes" choice value of the variables that indicates the HDDS

fsl_lcsi_stress1

the name of the variable that indicates the first stress LCSI strategy

fsl_lcsi_stress2

the name of the variable that indicates the second stress LCSI strategy

fsl_lcsi_stress3

the name of the variable that indicates the third stress LCSI strategy

fsl_lcsi_stress4

the name of the variable that indicates the fourth stress LCSI strategy

fsl_lcsi_crisis1

the name of the variable that indicates the first crisis LCSI strategy

fsl_lcsi_crisis2

the name of the variable that indicates the second crisis LCSI strategy

fsl_lcsi_crisis3

the name of the variable that indicates the third crisis LCSI strategy

fsl_lcsi_emergency1

the name of the variable that indicates the first emergency LCSI strategy

fsl_lcsi_emergency2

the name of the variable that indicates the second emergency LCSI strategy

fsl_lcsi_emergency3

the name of the variable that indicates the third emergency LCSI strategy

fsl_lcsi_stress

the name of the variable that indicates the calculation of the stress LCSI strategy

fsl_lcsi_crisis

the name of the variable that indicates the calculation of the crisis LCSI strategy

fsl_lcsi_emergency

the name of the variable that indicates the calculation of the stress LCSI strategy

fsl_lcsi_cat_yes

the name of the variable that indicates the highest category of the LCSI strategy used yes

fsl_lcsi_cat_exhaust

the name of the variable that indicates the highest category of the LCSI strategy used exhaustively

fsl_lcsi_cat

the name of the variable that indicates the highest category of the LCSI strategy

fsl_lcsi_yes_value

the "yes" choice value of the variables that indicates the LCSI strategies

fsl_fcs_cat

the name of the variable that indicates the food consumption score category

fsl_fcs_score

the name of the variable that indicates the food consumption score

fsl_rcsi_cat

the name of the variable that indicates the reduced coping strategy index category

fsl_rcsi_score

the name of the variable that indicates the reduced coping strategy index score

fsl_hhs_cat

the name of the variable that indicates the household hunger scale category

fsl_hhs_score

the name of the variable that indicates the household hunger scale score

fsl_hdds_cat

the name of the variable that indicates the household dietary diversity score category

fsl_hdds_score

the name of the variable that indicates the household dietary diversity score

fsl_fc_cell

the name of the variable that indicates the food consumption matrix score

fsl_fc_phase

the name of the variable that indicates the food consumption matrix phase

num_children

the name of the variable that indicates the number of children available in each household

income_types

a vector of the three income_types variables. By default, c("fsl_first_income_types","fsl_second_income_types","fsl_third_income_types")

sell_agri_prod

the "sell_agri_prod" choice value of the variables that indicates income from agriculture

sell_anim_prod

the "sell_anim_prod" choice value of the variables that indicates income from animal

residency_status

the name of the variable that indicates the residency status of HH, By default, "residency_status"

value_idp

the name of the choice value representing the idp residency status. By default, "idp"

tool.survey

This is the tool.survey dataset. By default NULL

label_colname

This is the label column in the tool survey. By default label::English

uuid

uuid variable

Value

a dataframe that includes all the logical flags related to food security and livelihoods. This includes: - flag_meat_cereal_ratio - flag_low_cereal - flag_low_fcs - flag_high_fcs - flag_low_oil - flag_sd_foodgroup - flag_protein_rcsi - flag_fcs_rcsi - flag_high_rcsi - flag_rcsi_children - flag_fcsrcsi_box - flag_sd_rcsicoping - flag_severe_hhs - flag_lcsi_coherence - flag_lcsi_severity - flag_lcsi_na - flag_lcsi_liv_agriculture - flag_lcsi_liv_livestock - flag_lcsi_displ - flag_fc_cell - flag_low_sugar_cond_hdds

Examples

tool.survey <- impactR4PHU_survey_template
df <- data.frame(
  fsl_fcs_cereal = c(1, 4),
  fsl_fcs_legumes = c(3, 3),
  fsl_fcs_dairy = c(1, 6),
  fsl_fcs_meat = c(2, 3),
  fsl_fcs_veg = c(5, 4),
  fsl_fcs_fruit = c(1, 4),
  fsl_fcs_oil = c(1, 4),
  fsl_fcs_sugar = c(6, 2),
  fsl_rcsi_lessquality = c(2,4),
  fsl_rcsi_borrow = c(1,4),
  fsl_rcsi_mealsize = c(4,5),
  fsl_rcsi_mealadult = c(2,4),
  fsl_rcsi_mealnb = c(3,2),
  fsl_hhs_nofoodhh = c("yes","no"),
  fsl_hhs_nofoodhh_freq = c("rarely", NA),
  fsl_hhs_sleephungry= c("no","no"),
  fsl_hhs_sleephungry_freq = c(NA, NA),
  fsl_hhs_alldaynight= c("no","yes"),
  fsl_hhs_alldaynight_freq = c(NA, "often"),
  fsl_hdds_cereals = c("yes","no"),
  fsl_hdds_tubers = c("yes","no"),
  fsl_hdds_legumes = c("yes","no"),
  fsl_hdds_veg = c("no","no"),
  fsl_hdds_fruit = c("yes","no"),
  fsl_hdds_meat = c("yes","no"),
  fsl_hdds_fish = c("yes","no"),
  fsl_hdds_dairy = c("no","no"),
  fsl_hdds_eggs = c("yes","no"),
  fsl_hdds_sugar = c("yes","no"),
  fsl_hdds_oil = c("yes","no"),
  fsl_hdds_condiments = c("yes","no"),
  fsl_lcsi_stress1 = c("not_applicable","yes"),
  fsl_lcsi_stress2 = c("no_had_no_need","not_applicable"),
  fsl_lcsi_stress3 = c("not_applicable","yes"),
  fsl_lcsi_stress4 = c("no_exhausted","yes"),
  fsl_lcsi_crisis1 = c("no_exhausted","yes"),
  fsl_lcsi_crisis2 = c("no_had_no_need","yes"),
  fsl_lcsi_crisis3 = c("no_had_no_need","yes"),
  fsl_lcsi_emergency1 = c("no_had_no_need","yes"),
  fsl_lcsi_emergency2 = c("not_applicable","no_exhausted"),
  fsl_lcsi_emergency3 = c("not_applicable","yes"),
  fsl_lcsi_stress = c(1, 1),
  fsl_lcsi_crisis = c(1, 1),
  fsl_lcsi_emergency = c(0, 1),
  fsl_lcsi_cat_yes = c("None","Emergency"),
  fsl_lcsi_cat_exhaust = c("Crisis","Emergency"),
  fsl_lcsi_cat = c("Crisis","Emergency"),
  fsl_fcs_cat = c("Borderline","Acceptable"),
  fsl_fcs_score = c(32.5,64.0),
  fsl_rcsi_cat= c("Medium","High"),
  fsl_rcsi_score= c(17,31),
  fsl_hhs_cat= c("No or Little","Moderate"),
  fsl_hhs_score= c(1,2),
  fsl_hdds_cat= c("High","Low"),
  fsl_hdds_score= c(10,0),
  fsl_fc_cell= c(22,33),
  fsl_fc_phase= c("Phase 2 FC","Phase 3 FC"),
  num_children= c(2,3),
  fsl_first_income_types = c("sell_agri_prod","trader"),
  fsl_second_income_types = c("daily_labour_skilled","sell_anim_prod"),
  fsl_third_income_types = c("hum_assistance","none"),
  residency_status = c("idp", "host"),
  enumerator = c("team1","team2"),
  uuid= c("31d0cfb8-21d7-414b4f-94999f-04a15ce39d78","205d37b1-5a6f-44484d-b3b1ba-4eafbdc50873")
  )

check_fsl_flags(.dataset = df, tool.survey = tool.survey)
#> # A tibble: 2 × 87
#>   fsl_fcs_cereal fsl_fcs_legumes fsl_fcs_dairy fsl_fcs_meat fsl_fcs_veg
#>            <dbl>           <dbl>         <dbl>        <dbl>       <dbl>
#> 1              1               3             1            2           5
#> 2              4               3             6            3           4
#> # ℹ 82 more variables: fsl_fcs_fruit <dbl>, fsl_fcs_oil <dbl>,
#> #   fsl_fcs_sugar <dbl>, fsl_rcsi_lessquality <dbl>, fsl_rcsi_borrow <dbl>,
#> #   fsl_rcsi_mealsize <dbl>, fsl_rcsi_mealadult <dbl>, fsl_rcsi_mealnb <dbl>,
#> #   fsl_hhs_nofoodhh <chr>, fsl_hhs_nofoodhh_freq <chr>,
#> #   fsl_hhs_sleephungry <chr>, fsl_hhs_sleephungry_freq <lgl>,
#> #   fsl_hhs_alldaynight <chr>, fsl_hhs_alldaynight_freq <chr>,
#> #   fsl_hdds_cereals <chr>, fsl_hdds_tubers <chr>, fsl_hdds_legumes <chr>, …