Skip to contents

Add the food consumption matrix to the dataset

Usage

add_eg_fcm_phase(
  dataset,
  fcs_column_name = "fcs_cat",
  rcsi_column_name = "rcsi_cat",
  hhs_column_name = "hhs_cat",
  fcs_categories_acceptable = "Acceptable",
  fcs_categories_poor = "Poor",
  fcs_categories_borderline = "Borderline",
  rcsi_categories_low = "No to Low",
  rcsi_categories_medium = "Medium",
  rcsi_categories_high = "High",
  hhs_categories_none = "None",
  hhs_categories_little = "Little",
  hhs_categories_moderate = "Moderate",
  hhs_categories_severe = "Severe",
  hhs_categories_very_severe = "Very Severe"
)

Arguments

dataset

A dataframe

fcs_column_name

A string specifying the column name of the food consumption score in the dataset

rcsi_column_name

A string specifying the column name of the reduced coping strategy index in the dataset

hhs_column_name

A string specifying the column name of the household hunger scale in the dataset

fcs_categories_acceptable

The name of the value "Acceptable" (by default) in the fcs categories

fcs_categories_poor

The name of the value "Poor" (by default) in the fcs categories

fcs_categories_borderline

The name of the value "Borderline" (by default) in the fcs categories

rcsi_categories_low

The name of the value "No to Low" (by default) in the rcsi categories

rcsi_categories_medium

The name of the value "Medium" (by default) in the rcsi categories

rcsi_categories_high

The name of the value "High" (by default) in the rcsi categories

hhs_categories_none

The name of the value "None" (by default) in the hhs categories

hhs_categories_little

The name of the value "Little" (by default) in the hhs categories

hhs_categories_moderate

The name of the value "Moderate" (by default) in the hhs categories

hhs_categories_severe

The name of the value "Severe" (by default) in the hhs categories

hhs_categories_very_severe

The name of the value "Very Severe" (by default) in the hhs categories

Value

this function returns a dataframe with a column called fc_cell that includes values from 1 to 45 representing the Food Consumption Score Matrix and the fc_phase column that includes the different 5 phases of food consumption

Examples

test_data <- data.frame(
  fcs_cat = c("Acceptable", "Poor", "Borderline", "Acceptable"),
  rcsi_cat = c("No to Low", "Medium", "No to Low", "High"),
  hhs_cat = c("None", "Little", "Severe", "Very Severe")
)
add_eg_fcm_phase(test_data,
  fcs_column_name = "fcs_cat",
  rcsi_column_name = "rcsi_cat",
  hhs_column_name = "hhs_cat",
  fcs_categories_acceptable = "Acceptable",
  fcs_categories_poor = "Poor",
  fcs_categories_borderline = "Borderline",
  rcsi_categories_low = "No to Low",
  rcsi_categories_medium = "Medium",
  rcsi_categories_high = "High",
  hhs_categories_none = "None",
  hhs_categories_little = "Little",
  hhs_categories_moderate = "Moderate",
  hhs_categories_severe = "Severe",
  hhs_categories_very_severe = "Very Severe"
)
#> Warning: Please check if the hhs categories parameter passes is matching the values in your data