ofrendo
3/4/2016 - 9:02 AM

Replace all occurences of a string with gsub

Replace all occurences of a string with gsub

gsub(pattern, replacement, x, ignore.case = FALSE, perl = FALSE,
    fixed = FALSE, useBytes = FALSE)
    
x <- c("Hello", "world!")
x <- gsub("o", 0, x)
x
[1] "Hell0"  "w0rld!"