[R] Can anyone please tell me how to strip the white spaces from a character vector?

2005-10-25 Thread roger bos
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@stat.math.ethz.ch

Re: [R] Can anyone please tell me how to strip the white spaces from a character vector?

2005-10-25 Thread Sean Davis
On 10/25/05 8:51 AM, roger bos [EMAIL PROTECTED] wrote: 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]]

Re: [R] Can anyone please tell me how to strip the white spaces from a character vector?

2005-10-25 Thread cgb
Quoting roger bos [EMAIL PROTECTED]: 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]]

Re: [R] Can anyone please tell me how to strip the white spaces from a character vector?

2005-10-25 Thread Marc Schwartz
On Tue, 2005-10-25 at 08:51 -0400, roger bos wrote: 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 Roger, See the next to last set of examples in ?sub. a -

Re: [R] Can anyone please tell me how to strip the white spaces from a character vector?

2005-10-25 Thread Romain Francois
Le 25.10.2005 14:51, roger bos a écrit : 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 gsub(' ','',a$tic) -- visit the R Graph Gallery :

Re: [R] Can anyone please tell me how to strip the white spaces from a character vector?

2005-10-25 Thread roger bos
Thanks to everyone for the gsub function. The white spaces were generated by reading in the file, but its a fixed width file and I only need some of the columns, so this was the easiest way to do it. Thanks, Roger On 10/25/05, Marc Schwartz [EMAIL PROTECTED] wrote: On Tue, 2005-10-25 at

Re: [R] Can anyone please tell me how to strip the white spaces from a character vector?

2005-10-25 Thread Wuming Gong
Try trim() in gdata package. Wuming On 10/25/05, roger bos [EMAIL PROTECTED] wrote: 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

Re: [R] Can anyone please tell me how to strip the white spaces from a character vector?

2005-10-25 Thread Uwe Ligges
roger bos wrote: 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? Not beeing an expert for regular expressions, I'd try sub( *$, , sub(^ *, , a$tic)) to strip from beginnings