Francisco J. Zagmutt
2005-Oct-25 20:34 UTC
[R] Can anyone please tell me how to strip the white spaces from acharacter
I addition to all the many good options presented you can also use trimWhiteSpace{limma} which is just a higher level call to sub() x=scan("clipboard", what="character") Read 6 items x [1] "AIR " "ABCB " "ABXA " "ACMR " "ADCT " "ADEX " trimWhiteSpace(x) [1] "AIR" "ABCB" "ABXA" "ACMR" "ADCT" "ADEX" Cheers Francisco>From: roger bos <roger.bos at gmail.com> >To: "(r-help at stat.math.ethz.ch.)" <R-help at stat.math.ethz.ch> >Subject: [R] Can anyone please tell me how to strip the white spaces from >acharacter vector? >Date: Tue, 25 Oct 2005 08:51:48 -0400 > >for example: > > a$tic[1:10] >[1] "AIR " "ABCB " "ABXA " "ACMR " "ADCT " "ADEX " >[7] "ABM " "AFCE " "AG " "ATG " > Can anyone please tell me how to strip the white spaces from a$tic? > Thanks, > Roger > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! >http://www.R-project.org/posting-guide.html