################################################################################
#
#' Function to calculate income dimension indicators of the Abbreviated
#' Women's Empowerment in Agriculture Index (A-WEAI).
#'
#' @param df Dataframe containing A-WEAI income indicator variables.
#'
#' @return A vector recode of WEAI income dimension of 1 (deficit) or
#' 0 (non-deficit)
#'
#' @examples
#'
#' calculate_income(df = individual)
#'
#' @export
#
################################################################################
calculate_income <- function(df) {
y <- ifelse(df[["weai_dimension1ad"]] == 98, NA,
ifelse(df[["weai_dimension1ad"]] == 1, 1, 0))
return(y)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.