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
>
>