Welcome !
Could you try with mutate_all?
library(tidyverse)
df1 <- tibble(
hair1 = c("Long Hair", "Short Hair", "Medium Hair", "Medium Hair"),
hair2 = c("Long Hair", "Long Hair", "Short Hair", "Medium Hair"),
hair3 = c("Long Hair", "Short Hair", "Long Hair", "Medium Hair")
)
df2 <- df1 %>%
mutate_all(funs(str_replace(., "Long Hair", " ")))
This is the way I address these type of problems, maybe it could help. However, I'm not sure if there is a better approach.