I am currently evaluating a study as part of a seminar.
The scale created in the survey has the following variables:
4 = very negative
5 = negative
6 = rather negative
3 = rather positive
2 = positive
1 = very positive
Now I have the problem that it would have been better to have the variables in a different order:
1 = very negative
2 = negative
3 = rather negative
4 = rather positive
5 = positive
6 = very positive
I have to turn in my term paper on Sunday and I am really getting desperate right now and hope someone can help me. Is there a command I can use in R-Studio to change the names of the variables without losing the data? In particular, my created scales do not work with the old order of the scales ...
My dataset is called data_darkmode3. The scale is in 19 different columns. The participants had to rate 19 images in a 6 Likert scale.
Do I need to rename for each column?
Or is it possible like this?
data_darkmode3 = tibble(T001:T019 = c(4,5,6,3,2,1)) %>%
mutate(T001:T019 = case_when(
T001:T019 == 4 ~ 1,
T001:T019 == 5 ~ 2,
T001:T019 == 6 ~ 3,
T001:T019 == 3 ~ 4,
T001:T019 == 2 ~ 5,
T001:T019 == 1 ~ 6,
))
Sorry for asking, I don't have much experience with R..
The old data does not have to be saved, but only changed or overwritten, if possible
Yes, if that gets to your desired result, then your approach is one way to solve it (there are usually multiple ways to arrive at the same outcome). Nice job working through it!