I have a variable that looks like this:
> levels(Cambodia$`Income changed after 2020`)
[1] "Yes, I lost a total of income" "Yes, I lost a partial of income" "No, I earn the same amount of income"
[4] "Yes, I earn more income"
I want to combine "Yes, I earn more income"
and "No, I earn the same amount of income"
to form a new level in the variable, so that it would look like:
> levels(Cambodia$`Income changed after 2020`)
[1] "Yes, I lost a total of income" "Yes, I lost a partial of income" "No income loss"
I tried doing this but it did not work:
library(forcats)
Cambodia %>% fct_collapse(Cambodia$`Income changed after 2020` == c("Yes, I earn more income","No, I earn the same amount of income"))