mtex[3]<-"I need\'s a \"double quote\" with no backslash" mtex[3] [1] "I need's a \"double quote\" with no backslash" so how is it done? Thanks in advance, graham lawrence _________________________________________________________________ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
passing ", betrayed by the non-vanishing \
4 messages · graham lawrence, Peter Dalgaard, Thomas Lumley +1 more
"graham lawrence" <forporphyry at hotmail.com> writes:
mtex[3]<-"I need\'s a \"double quote\" with no backslash" mtex[3] [1] "I need's a \"double quote\" with no backslash" so how is it done? Thanks in advance,
You's got two of them in there already! Try cat(mtex[3], "\n") Printing character strings will always escape double quotes, backaslashes and various control characters. No way around that except by using cat().
O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 16 Apr 2002, graham lawrence wrote:
mtex[3]<-"I need\'s a \"double quote\" with no backslash" mtex[3] [1] "I need's a \"double quote\" with no backslash" so how is it done? Thanks in advance,
Do you want to construct a string that contains a double quote and no backslash or to print a double quote on the screen without printing a backslash? You've done the first, as this shows
a<-"\"" a
[1] "\""
nchar(a)
[1] 1 so a contains a single character, the double quote. To display on the screen without a backslash use
print(a,quote=F)
[1] " or
cat(a)
"> -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
PD> "graham lawrence" <forporphyry at hotmail.com> writes:
>>> mtex[3]<-"I need\'s a \"double quote\" with no backslash"
>>> mtex[3]
>>> [1] "I need's a \"double quote\" with no backslash"
>>> so how is it done? Thanks in advance,
PD> You's got two of them in there already! Try
> cat(mtex[3], "\n")
PD> Printing character strings will always escape double quotes,
PD> backaslashes and various control characters. No way around that except
PD> by using cat().
the really amusing thing about this topic: about a dozen mail
hosts from R-help subscribers have bounced the above message,
giving as reason
Diagnostic-Code: SMTP; 553 5.0.0 Unbalanced '"'
Quite a funny example of an error of the 2nd kind when trying to do spam/virus protection... Martin Maechler <maechler at stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO C16 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <>< -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._