Skip to content

Instantly share code, notes, and snippets.

View LibbyHeeren's full-sized avatar

Libby Heeren LibbyHeeren

View GitHub Profile
@LibbyHeeren
LibbyHeeren / recode_from_named_list.R
Created June 23, 2025 05:15
Recoding a column using a named list as a dictionary in R
# Load packages
library(dplyr)
# Create a named list mapping likert numbers to full responses
likert_mapping <- list(
"1" = "Strongly disagree",
"2" = "Disagree",
"3" = "Neutral",
"4" = "Agree",
"5" = "Strongly agree"