I have a problem, I used fct_recode to change the text responses to numbers
data <- data %>%
mutate(sustainability_sq001 = fct_recode(sustainability_sq001,
"1" = "Completely Disagree",
"2" = "Disagree",
"3" = "Somewhat Disagree",
"4" = "Somewhat Agree",
"5" = "Agree",
"6" = "Completely Agree"))
but R cannot calculate with it: Error in rowMeans(.): 'x' must be numeric
When I use: data$sustainability_sq001 <- as.numeric(data$sustainability_sq001) to change the numbers
It changes the of my responses:
Before:
sustainability_sq001 n
1 5 31
2 6 11
3 3 6
4 4 26
5 1 5
6 2 3
Option 5 had the most responses with 31, and R ranked it from 1-5 smh.
After:
sustainability_sq001 n
1 1 31
2 2 11
3 3 6
4 4 26
5 5 5
6 6 3
R adjusted the responses to fit the ranking, which I do not want