Skip to content
Prev 79647 / 398502 Next

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