Skip to contents

This function categorizes occupancy arrangements into high, medium, or low risk based on provided criteria.

Usage

add_occupancy_cat(
  df,
  occupancy = "hlp_occupancy",
  high_risk = c("no_agreement"),
  medium_risk = c("rented", "hosted_free"),
  low_risk = c("ownership"),
  undefined = c("dnk", "pnta", "other")
)

Arguments

df

A data frame containing occupancy arrangement data.

occupancy

Component column: Occupancy arrangement.

high_risk

Character vector of high risk occupancy arrangements.

medium_risk

Character vector of medium risk occupancy arrangements.

low_risk

Character vector of low risk occupancy arrangements.

undefined

Character vector of undefined response codes (e.g. "Prefer not to answer").

Value

A data frame with an additional column:

  • hlp_occupancy_cat: Categorized occupancy arrangement: "high_risk", "medium_risk", "low_risk", or "undefined".