The paste is doing the right thing -- it is how it is displayed
that matters:

> jj <- paste("hello", "\"world\"")
> jj
[1] "hello \"world\""
> cat(jj)
hello "world"> print(jj, quote=FALSE)
[1] hello "world"

Patrick Burns

Burns Statistics
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")

Philippe Hup� wrote:

Hello,

I would like to write in a variable the following string :

Hello "World"

If I do cat("Hello ","\"World\""), I have the good result on the screen but it can not be affected to a variable. If I do the same thing with paste paste("Hello ","\"World\"") it does not work since \" seems to be not recognized. So what is the trick to do that.

Thanks,

Philippe

______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to