Efficiently replacing multiple values in the same column + grouping values conditionally to one category

Use %in% instead of ==

data$fac[data$fac %in% c("estuio", "estudy", "study") ] <- "studio"

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

1 Like