title: Setting work directory in knitr using opts_chunk$set(root.dir = ...) doesn't work
body: <p>My R project is structured like a package with directories <code>/R</code>, <code>/vignettes</code>, <code>/data</code> etc. In one of my Rmd docs in <code>/vignettes</code> I source a script which in located in <code>/R</code>. Inside this script I use <code>read.csv()</code> to load a file located in <code>inst/extdata/</code>.<br>
  The problem now is that by default the working directory inside the Rmd file is the directory where the file is located. Let's call it <code>/Users/Me/Docs/Proj/vignettes</code>. However in order for the R script to run the working directory needs to be the project's main directory (<code>/Users/Me/Docs/Proj</code>).<br>
  I tried to change the working directory in the Rmd file using <code>knitr::opts_chunk$set(root.dir = normalizePath("..")</code>. However apparently this <em>doesn't</em> change the working directory since if I call <code>getwd()</code> after it the output is still <code>/Users/Me/Docs/Proj/vignettes</code> whereas <code>knitr::chunk_opts$get("root_dir")</code> returns <code>/Users/Me/Docs/Proj</code>.  </p>
  
  <p>Here is a minimal example Rmd file:  </p>
  
  <pre><code>```{r}
  getwd()  # returns 'Users/Me/Docs/Proj/vignettes'
  knitr::opts_chunk$set(root.dir = normalizePath(".."))  # should change the working directory to 'Users/Me/Docs/Proj'
  getwd()  # again returns 'Users/Me/Docs/Proj/vignettes'
  knitr::opts_chunk$get("root.dir")  # returns 'Users/Me/Docs/Proj'
  ```
  </code></pre>
  
  <p>I am using RStudio Version 0.99.435. Here is my session Info:  </p>
  
  <pre><code>R version 3.2.0 (2015-04-16)  
  Platform: x86_64-apple-darwin14.3.0 (64-bit)  
  Running under: OS X 10.10.3 (Yosemite)  
  
  locale:
  [1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  loaded via a namespace (and not attached):
  [1] htmltools_0.2.6 tools_3.2.0     yaml_2.1.13     rmarkdown_0.6.1 digest_0.6.8   
  </code></pre>
  
  <p>Any help is kindly appreciated. If you need more info post a comment to the question. Thanks in advance!</p>