title: What is the difference between a single quote and double quote in Yaml header for r Markdown?
body: <p>I am getting an error in my r Markdown file that I am compiling using knitr in RStudio. I'm not really sure where this 'error' should be directed. It doesn't appear to be an 'R' error per say.</p>
  
  <p>If I create an R markdown document with the following YAML header content, I can knit the file just fine:</p>
  
  <pre><code>---
  title: "Eye tracking AOI plots"
  author: "Steven Vannoy"
  date:  "`r format(Sys.time(), '%I:%M')`"
  output: html_document
  ---
  </code></pre>
  
  <p>But if I merely change the single quotes inside the format statement to double quotes (which is what I was originally using), </p>
  
  <pre><code>---
  title: "Eye tracking AOI plots"
  author: "Steven Vannoy"
  date:  "`r format(Sys.time(), "%I:%M")`"
  output: html_document
  ---
  </code></pre>
  
  <p>I get the following run time error:</p>
  
  <pre><code>Error in yaml::yaml.load(enc2utf8(string), ...) : 
    Scanner error: while scanning for the next token at line 3, column 32found character that cannot start any token at line 3, column 32
  Calls: &lt;Anonymous&gt; ... yaml_load_utf8 -&gt; mark_utf8 -&gt; &lt;Anonymous&gt; -&gt; .Call
  Execution halted
  </code></pre>
  
  <p>I experimented around enough to know that it is the colon ':' that is causing the problem, the error is not produced if you use "%A %d" for example.</p>
  
  <p>I searched around and found a number of assertions that single and double quotes are generally equivalent in R, although you can not pair a double quote with a single quote and have it act like two double quotes.</p>
  
  <p>Obviously I have a working code sample that does what I need to do, but I generally use double quotes and am wondering how I can know when I should be using single quotes?</p>