# Create a sample survey data frame
survey_df <- data.frame(
person_id = c(1, 2, 3, 4, 5),
question_concept_id = rep(40192441, 5),
answer = c("0", "1", "2", "3", "Skip")
)
# Compute number of moves in the past year
num_moves_scores <- calc_num_moves(survey_df)
head(num_moves_scores)
Run the code above in your browser using DataLab