Rank Top 3 Frequent Expenditure Types
Source:R/add_expenditure_type_freq_rank.R
add_expenditure_type_freq_rank.Rd
This function ranks the top 3 most frequent 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 expenditure types.
Prerequisite function:
add_expenditure_type_zero_freq.R
Usage
add_expenditure_type_freq_rank(
df,
expenditure_freq_types = c("cm_expenditure_frequent_food",
"cm_expenditure_frequent_rent", "cm_expenditure_frequent_water",
"cm_expenditure_frequent_nfi", "cm_expenditure_frequent_utilities",
"cm_expenditure_frequent_fuel", "cm_expenditure_frequent_transportation",
"cm_expenditure_frequent_communication", "cm_expenditure_frequent_other"),
id_col = "uuid"
)