# Convert raw scores to scale scores using lists
map_scores(conv = list(1, 2, 3, 4, 5),
map_raw = list(1, 2, 3, 4, 5),
map_scale = list(20, 21, 22, 23, 24))
# Convert raw scores to scale scores using a data frame
df <- data.frame(Id = 1:5, RawScore = 1:5)
df_map <- data.frame(Raw = 1:5, Scale = 20:24)
df$ScaleScore <- map_scores(df, df_map, conv = "RawScore", map_raw = "Raw", map_scale = "Scale")
Run the code above in your browser using DataLab