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

From: Sean Davis <sdavis2_at_mail.nih.gov>
Date: Tue 25 Oct 2005 - 23:03:14 EST


On 10/25/05 8:51 AM, "roger bos" <roger.bos@gmail.com> 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]]
>
> ______________________________________________
> R-help@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
>

See ?gsub.

gsub(' ','',a$tic)

Sean



R-help@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 Received on Tue Oct 25 23:12:01 2005

This archive was generated by hypermail 2.1.8 : Wed 26 Oct 2005 - 00:12:47 EST