Я уверен, что ваша переменная классифицируется как фактор.Так что просто объедините некоторые факторы, используя этот подход.
set.seed(42) # for reproducibility
# mimicking your data
df1 <- data.frame(var=rdunif(100, 10))
df1$var <- factor(df1$var, 1:10, labels=c("Couldn't be worse", "Very bad",
"Bad", "Meh", "So-so", "Okay",
"Good", "Very Good", "Great",
"Really great"))
df1$var1 <- df1$var
# merging levels
levels(df1$var1) <- list("Very negative"=c("Couldn't be worse", "Very bad"),
"negative" = c("Bad", "Meh"),
"neutral" = c("So-so", "Okay"),
"positive"=c("Good", "Very Good"),
"very positive"=c("Great", "Really great"))
уступая
> tail(df1, 10)
var var1
91 Very bad Very negative
92 Very Good positive
93 Very bad Very negative
94 Very bad Very negative
95 Couldn't be worse Very negative
96 Couldn't be worse Very negative
97 Okay neutral
98 Very bad Very negative
99 Very Good positive
100 Very Good positive