I would like to first recode a value in a battery of questions and then rescale the results from 0 to 1. I read through here to learn how to apply sequential functions but my results are not rescaled.
var1<-sample(seq(1,11,1), size=100, replace=T)
var2<-sample(seq(1,11,1), size=100, replace=T)
library(tidyverse)
library(scales)
df<-data.frame(var1, var2)
df %>%
mutate(
across(
starts_with("var"), ~{
scales::rescale(as.numeric(car::Recode(.x, "11=5"), to=c(0,1)))
.x
}
))