[R] Substitutions in strings.
fredrik.karlsson at ling.umu.se
Mon Jul 1 15:42:39 CEST 2002
Sorry to bother you with the potentially not too bright question, but
since I cannot get it to work, I'll have to ask someone..
I've got this vector:
 sal skal skal bak b_r d_ gal kal l_r n_r pak
 sal sl_r sn_r spak sp_r st_r s_ bak d_ gal l_r
 p_r sak sl_r sp_r t_ kal n_r s_ st_r sak kal
 s_ spik t_ n_r spik spak gal pak p_r sak sl_r
 s_ s_r t_ b_r s_r bak d_ l_r skal sp_r
 st_r n_r bak b_r d_ l_r n_r pak p_r sal
 sn_r spak sp_r st_r s_ s_r t_ bak d_ l_r
 sl_r sn_r spak spik s_r t_ gal kal gal n_r
 n_r n_r bak b_r d_ gal l_r sak sal skal
 spik sp_r st_r s_ s_r gal kal n_r sak kal
What I whant to do is to substitute all the '_'s in the vector whith
some other character.
Trying it out, this works.
 "A" "AaA"
However, this does not..
Error in gsub(pattern, replacement, x, ignore.case, extended) :
Can't see why. Please help me out..
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