This is NOT critical. It arose due to a fumble fingers when developing
an R example, but slightly intriguing.

How could one build a string from substrings with a single backslash (\)
as separator. Here's the reproducible example:

fname = "John"; lname = "Smith"
paste(fname, lname)
paste(fname, lname, sep=" / ")
# BUT there's a glitch with backslash
paste(fname, lname, sep=" \ ") # because of escaping character
paste(fname, lname, sep=' \ ')
paste(fname, lname, sep=' \\ ') # because of escaping character
bslash <- "\\"
print(bslash)
paste(fname, lname, sep=bslash)

Possibly the answer is that R never allows a single backslash in its
strings, but I can imagine possible cases where I might want to output
such lines, for example, in documenting this.

Best, JN

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to