[R] blank space escape sequence in R?

Mike Miller mbmiller+l at gmail.com
Mon Apr 25 17:26:10 CEST 2011


On Mon, 25 Apr 2011, Mark Heckmann wrote:

> I use a function that inserts line breaks ("\n" as escape sequence) 
> according to some criterion when there are blanks in the string. e.g. 
> "some text \nand some more text".
>
> What I want now is another form of a blank, so my function will not 
> insert a ?\n" at that point. e.g. "some text\spaceand some more text"
>
> Here "\space" stands for some escape sequence for a blank, which is what 
> I am looking for. So what I need is something that will appear as a 
> blank when printed but not in the string itself.


Is it possible to use \x20 or some similar way to evoke the hexadecimal 
ascii form of blank?  That works in perl as does \040 for the octal form.

Mike



More information about the R-help mailing list