# example data
test_sentences <- c("The quick brown fox quickly", "jumps over the lazy dog")
Let's make the brown fox red:
sub("brown","red", test_sentences)
#[1] "The quick red fox quickly" "jumps over the lazy dog"
Now, ...