Skip to content
Prev 181094 / 398503 Next

Re placing a "+" in a string

Here are a few ways:

gsub("[+]", "K", "8.00+00")
gsub("\\+", "K", "8.00+00")
gsub("+", "K", "8.00+00", fixed = TRUE)

Note that with gsubfn you can replace several at once as
it is like gsubfn but can take a replacement translation list:

library(gsubfn)
gsubfn(".", list("+" = " plus", "0" = " zero"), "8.00+00")
# gives this: "8. zero zero plus zero zero"
On Thu, May 21, 2009 at 11:45 AM, Tom La Bone <booboo at gforcecable.com> wrote: