[R] Suppress blanks/spaces in character

From: <thsudler_at_swissonline.ch>
Date: Fri 27 Oct 2006 - 16:24:02 GMT


Hi all

I'm have a character vector and would like to suppress the blanks if there are more than one after the other.

Example:

Character value is: "abc def ghi"
The result should be: "abc def ghi"

I know that it's possible to delete the leading blanks with the command "trim". But how can I delete blanks within a character?

Thank you very much in advance for an answer Thomas



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 and provide commented, minimal, self-contained, reproducible code. Received on Sat Oct 28 02:27:17 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 27 Oct 2006 - 19:30:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.