# Create a sample survey data frame
survey_df <- data.frame(
person_id = c(1, 2, 3, 4, 5),
question_concept_id = rep(40192526, 5),
answer = c("Yes", "No", "Yes", "Prefer Not To Answer", "Skip")
)
# Compute whether participants speak a language other than English at home
other_language_scores <- calc_other_language(survey_df)
head(other_language_scores)
Run the code above in your browser using DataLab