I\'m looking for a way to use the find and replace function in R to replace the entire value of a string, rather than just the matching part of the string. I have a dataset with
You can also simply use gsub() and add .* before and after the pattern like this:
gsub()
.*
string<-"TransRights" gsub(".*sR.*","HumanRights",string)
The outcome would be
HumanRights