I need the to escape the double quotes in the following example and R returns :
xx<-"the road is 'rocky all \"the\" way'"
xx
[1] "the road is 'rocky all \"the\" way'"
The final string should contain both the single and the double quotes
the road is 'rocky all "the" way'
How can I achieve this?
You already achieved it. It's just that print()
escapes the quotes when displaying them :
R> xx <- "the road is 'rocky all \"the\" way'"
R> cat(xx)
the road is 'rocky all "the" way'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With