Skip to contents

Add income source categories, count, and ranking top 3

Usage

add_income_source_rank(
  df,
  emergency = c("cm_income_source_assistance_n", "cm_income_source_support_friends_n",
    "cm_income_source_donation_n"),
  unstable = c("cm_income_source_casual_n", "cm_income_source_social_benefits_n",
    "cm_income_source_rent_n", "cm_income_source_remittances_n"),
  stable = c("cm_income_source_salaried_n", "cm_income_source_own_business_n",
    "cm_income_source_own_production_n"),
  other = "cm_income_source_other_n",
  id_col = "uuid"
)

Arguments

df

A data frame.

emergency

The names of the columns that contain emergency income sources.

unstable

The names of the columns that contain unstable income sources.

stable

The names of the columns that contain stable income sources.

other

The name of the column that contains other income sources.

id_col

The name of the column that contains the unique identifier.