1) gsubfn gsubfn gsubfn gsub, , , , -. , .
library(gsubfn)
gsubfn("\\S+", setNames(as.list(b), a), c)
:
[1] "i am going to the party" "he would go too"
2) gsub :
cc <- c
for(i in seq_along(a)) cc <- gsub(a[i], b[i], cc, fixed = TRUE)
:
> cc
[1] "i am going to the party" "he would go too"