Rank Top 3 Infrequent Expenditure Types
Source:R/add_expenditure_type_infreq_rank.R
add_expenditure_type_infreq_rank.Rd
This function ranks the top 3 most infrequent expenditure types for each household based on the amount spent on various categories. It adds new columns to the input data frame indicating the top 3 infrequent expenditure types.
Prerequisite function:
add_expenditure_type_zero_infreq.R
Usage
add_expenditure_type_infreq_rank(
df,
expenditure_infreq_types = c("cm_expenditure_infrequent_shelter",
"cm_expenditure_infrequent_nfi", "cm_expenditure_infrequent_health",
"cm_expenditure_infrequent_education", "cm_expenditure_infrequent_debt",
"cm_expenditure_infrequent_other"),
id_col = "uuid"
)