# Create a sample survey data frame
survey_df <- data.frame(
person_id = rep(1:3, each = 6),
question_concept_id = rep(c(40192420, 40192522, 40192412,
40192469, 40192456, 40192386), times = 3),
answer_concept_id = sample(c(40192514, 40192455, 40192408, 40192422),
18, replace = TRUE)
)
# Compute neighborhood physical disorder scores
physical_disorder_scores <- calc_physical_disorder(survey_df)
head(physical_disorder_scores)
Run the code above in your browser using DataLab