Agustin Lobo wrote:
I wish to write  "" using paste(), but

paste() doesn't write anything, it constructs character vectors. It is the auto-printing that is adding the backslashes. Use cat() to write things without them:

> cat(paste("\"","Hola","\"",sep=""))
"Hola"

In fact, cat() is flexible and you could just use

cat("\"","Hola","\"",sep="")


 > paste("\"","Hola","\"",sep="")
[1] "\"Hola\""
 >


while the same approach works with ''
 > paste("\'","Hola","\'",sep="")
[1] "'Hola'"


why this difference? how could I do it to get "Hola" ?

print() puts double quotes around strings when it prints them; that means it needs backslash escapes on double quotes within the string, but single quotes are fine.
Your vector did contain "Hola", but print() escaped the quotes.

Duncan Murdoch
Thanks

Agus



______________________________________________
R-help@r-project.org 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.

Reply via email to