[R] Quotes inside char string
MikeP at kfoc.net
Tue Dec 20 20:31:34 CET 2011
Thank you Uwe. I can't get my sqlQuery to work and thought that it must be the "\" embedded in the text string, I guess not if R doesn't pass the "\". Thanks for your response.
From: Uwe Ligges [mailto:ligges at statistik.tu-dortmund.de]
Sent: Tuesday, December 20, 2011 1:20 PM
To: Mike Pfeiff
Cc: 'R-help at r-project.org'
Subject: Re: [R] Quotes inside char string
On 20.12.2011 20:10, Mike Pfeiff wrote:
> How do I return a character string with quotes inside string?
> For example, what logic do I use if I want to return the following:
> Test Score="A"
> I tried the following ....
> Score<-paste("Test Score=","A",sep='"')
> But it returned a "\" inside:
> "Test Score=\"A"
> Any assistance would be greatly appreciated.
That is the print()ed R representation of it. The underlying value
*within* the quoted string is actually:
and that is always true. E.g. in your example with the SQL query this question probably is derived from.
cat() shows the actual version (but does not return) it.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help