[R] How to print a double quote

Roger Bivand Roger.Bivand at nhh.no
Thu Feb 22 20:23:12 CET 2007


On Thu, 22 Feb 2007, Bos, Roger wrote:

> Can anyone tell me how to get R to include a double quote in the middle
> of a character string?  

FAQ 7.37 Why does backslash behave strangely inside strings?

> 
> For example, the following code is close:
> 
> > fnd<-"Open fnd 'test'"
> >            cat(fnd)
> Open fnd 'test'>            
> >
> 
> But instead of Open fnd 'test' I need: Open fnd "test".  Difference
> seems minor, but I am writing batch files for another program to read in
> and it has to have the double quotes to work.  
> 
> Thanks in advance for any help or ideas,
> 
> Roger
> 
> ********************************************************************** * 
> This message is for the named person's use only. It may 
> contain confidential, proprietary or legally privileged 
> information. No right to confidential or privileged treatment 
> of this message is waived or lost by any error in 
> transmission. If you have received this message in error, 
> please immediately notify the sender by e-mail, 
> delete the message and all copies from your system and destroy 
> any hard copies. You must not, directly or indirectly, use, 
> disclose, distribute, print or copy any part of this message 
> if you are not the intended recipient.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-help mailing list