# Create a sample survey data frame
survey_df <- data.frame(
person_id = c(1, 2, 3, 4, 5, 6, 7),
question_concept_id = rep(40192402, 7),
answer_concept_id = c(40192392, 40192479, 40192444, 40192460,
40192434, 40192468, 40192393)
)
# Compute housing quality needs
housing_quality_scores <- calc_housing_quality(survey_df)
head(housing_quality_scores)
Run the code above in your browser using DataLab