[R] What is the difference between double quote (") and single quote (')?

David Winsemius dwinsemius at comcast.net
Thu Sep 17 00:09:58 CEST 2009


On Sep 16, 2009, at 6:03 PM, Peng Yu wrote:

> Hi,
>
> According to my understand of the description in R-intro, double quote
> and single quote are the same. Can somebody confirm if this is the
> case?

Not exactly. It might be more correct to say that matched double  
quotes are the "same as" matche single quotes. You cannot close an  
expression you started with a double-quote by using a single-quote:

 > "test'
+ "
[1] "test'\n"

 > 'test"
+ "
+ "
+ '
[1] "test\"\n\"\n\"\n"
 >

-- 
David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list