[R] replacing text

nj7w@virginia.edu nj7w at virginia.edu
Fri Jul 12 19:07:55 CEST 2002


Hello,

I have a vector:
vect <- c("a.bcd.ef", "gh.i", ...of length n)

Position and number of dots vary, and not follow specific pattern.
I wish to replace all the dots by "_" in vect,  so that it
looks like
"a_bcd_ef","gh_i", etc..

I tried with grep and regexpr, but couldn't get the desired result.

Thanks.
-Nitin



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list