Hi everyone,
I have a rather simple question, even though I could solve it just by using excel, but I would like to know how to solve this type of issue in R.
So In my dataset, I have a character column similar to this
df1 <- tibble(
school = c("Alabama", "Alabama", "Alabama State University", "Alabama State University"),
)
df1$school <- gsub("Alabama", "University of Alabama", df1$school)
or
mutate_all(funs(str_replace(., "Alabama", "University of Alabama")))
I want to only change "Alabama" to "University of Alabama", with str_replace or gsub, however, by using these function it will also change "Alabama State University" to "University of Alabama State University".
Is there any way to solve this issue?
Thanks.