Skip to content
Prev 13797 / 398503 Next

paste

Giovanni Petris <gpetris at definetti.uark.edu> writes:
You can't. Notice that
[1] "1; 1; 3; 4; 4; 7; 12; 19; 23"

The thing that gets printed is a representation of the character
string not the string itself. To be syntactically valid, backslashes
must be doubled in the representation, and the only other way you get
them is as prefix to characters that has to be escaped.

Of course, you could do 

cat("[1] \"") ; cat(sort(x),sep="\\; ") ; cat("\"\n")
or 
cat("[1] \"", paste(sort(x), collapse="\\; "), "\"\n")

;-)