title: How to use fig.show=animate in knitr without administrator privileges
body: <p>I use Windows without administrator privileges hence I cannot set a path in the Windows PATH variable.</p>
  
  <p>The <code>ffmpeg.exe</code> file is in my <code>"U:/ProgramFiles/ImageMagick-6.8.5-5/"</code> folder.</p>
  
  <p>I have found how to use the <code>saveVideo()</code> function of the <code>animate</code> package:</p>
  
  <pre><code>ani.options(ffmpeg = shQuote('U:/ProgramFiles/ImageMagick-6.8.5-5/ffmpeg.exe'))
  saveVideo({
    par(mar = rep(3, 4))
    for (i in seq(pi/2, -4/3 * pi, length = 12)) {
      plot(0, 0, pch = 20, ann = FALSE, axes = FALSE)
      arrows(0, 0, cos(i), sin(i))
      axis(1, 0, "VI"); axis(2, 0, "IX")
      axis(3, 0, "XII"); axis(4, 0, "III"); box()
    }
  },
          video.name="mavideo.mp4",
          outdir="U:/Data/Rtests/Animation")
  </code></pre>
  
  <p>But I haven't find how to knit a Rmd file with the option <code>fig.show=animate</code> in a chunk, for instance:</p>
  
  <pre><code>```{r clock, fig.width=7, fig.height=6, fig.show='animate'}
  par(mar = rep(3, 4))
  for (i in seq(pi/2, -4/3 * pi, length = 12)) {
      plot(0, 0, pch = 20, ann = FALSE, axes = FALSE)
      arrows(0, 0, cos(i), sin(i))
      axis(1, 0, "VI"); axis(2, 0, "IX")
      axis(3, 0, "XII"); axis(4, 0, "III"); box()
  }
  ```
  </code></pre>
  
  <p>I have tried to modifiy the <code>hook_ffmpeg_html()</code> function  by only changing the <code>ffmpeg.cmd</code> variable:</p>
  
  <pre><code>```{r}
   hook_ffmpeg_html2 &lt;- function (x, options) 
  { 
      ........ 
      ffmpeg.cmd = paste("-y", "-r", 1/options$interval, 
          "-i", fig.fname, mov.fname) 
      ffmpeg.cmd &lt;-  paste('"U:/ProgramFiles/ImageMagick-6.8.5-5/ffmpeg"', ffmpeg.cmd) 
     ...... 
  } 
  opts_knit$set(animation.fun = hook_ffmpeg_html2) 
  ```
  </code></pre>
  
  <p>But this chunk does not work, below is the error message :</p>
  
  <pre><code>label: unnamed-chunk-1 
  Warning in block_exec(params) : 
    failed to tidy R code in chunk &lt;unnamed-chunk-1&gt; 
  reason: Error in base::parse(text = text, srcfile = NULL) : 
    21:14: unexpected symbol 
  20: options$out.height), if ("controls" %in% mov.opts) 
  21: "controls=\\"controls 
  </code></pre>