I have a string variable containing alphabet[a-z], space[ ], and apostrophe[\'],eg. x <- \"a\'b c\" I want to replace apostrophe[\'] with blank[], and replac
x <- \"a\'b c\"
I am a fan of the syntax that the %<>% and %>% opperators from the magrittr package provide.
%<>%
%>%
magrittr
library(magrittr) x <- "a'b c" x %<>% gsub("'", "", .) %>% gsub(" ", "_", .) x ##[1] "ab_c"
gusbfn is wonderful, but I like the chaining %>% allows.
gusbfn