[R] How to print a double quote

Tony Plate tplate at acm.org
Thu Feb 22 20:17:59 CET 2007


 > cat('Open fnd "test"\n')
Open fnd "test"
 > cat("Open fnd \"test\"\n")
Open fnd "test"
 >

Bos, Roger wrote:
> Can anyone tell me how to get R to include a double quote in the middle
> of a character string?  
> 
> 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.
>



More information about the R-help mailing list