title: knitr opts_knit$set(root.dir = "../") ignored when chunk_output_type: console
body: <p>My actual working directory of a .Rmd file is <code>"C:/Users/Camilo Erasso/Documents"</code>. I want to change it using <code>knitr::opts_knit$set(root.dir ="D:/CAMILO")</code> in the setup chunk.</p>
  
  <p>This works fine whit the default YAML option: <code>editor_options: chunk_output_type: inline</code>. But when I change this option to <code>editor_options: 
  chunk_output_type: console</code> the new working directory is ignored or not changed. </p>
  
  <p>I'm not used to work whit inline result (I prefer the console), for that reason I use this option. The same option can be changed in <code>RStudio&gt;Tools&gt;Global Options...&gt;R Markdown&gt;Show output inline for all R Markdown documents (uncheck)</code> or in the <code>.Rmd setting buttom (next to Knit buttom)&gt; Chunk Output in Console</code></p>
  
  <p>Toy example:</p>
  
  <pre><code>---
  title: "Example root.dir change"
  author: "Camilo Erasso"
  date: "2 de abril de 2019"
  output: html_document
  ---
  
  ```{r setup, include=FALSE}
  getwd() #[1] "C:/Users/Camilo Erasso/Documents"
  knitr::opts_chunk$set(echo = TRUE)
  knitr::opts_knit$set(root.dir ="D:/CAMILO")
  ```
  
  ```{r}
  getwd() #[1] "D:/CAMILO"
  ```
  </code></pre>
  
  <p>But when using the console output option:</p>
  
  <pre><code>---
  title: "Example root.dir change"
  author: "Camilo Erasso"
  date: "2 de abril de 2019"
  output: html_document
  editor_options: 
    chunk_output_type: console
  ---
  
  ```{r setup, include=FALSE}
  getwd() #[1] "C:/Users/Camilo Erasso/Documents"
  knitr::opts_chunk$set(echo = TRUE)
  knitr::opts_knit$set(root.dir ="D:/CAMILO")
  ```
  
  ```{r}
  getwd() #[1] "C:/Users/Camilo Erasso/Documents" or NOT CHANGED
  ```
  </code></pre>
  
  <p>This problem is slightly different from this: <a href="https://github.com/yihui/knitr/issues/1575" rel="nofollow noreferrer">https://github.com/yihui/knitr/issues/1575</a></p>
  
  <p>And related whit this: <a href="https://github.com/rstudio/rmarkdown/issues/1077" rel="nofollow noreferrer">https://github.com/rstudio/rmarkdown/issues/1077</a>
  and this <a href="https://stackoverflow.com/questions/41911487/html-notebook-ignores-global-chunk-options">html_notebook ignores global chunk options</a>.</p>
  
  <p>Is this and RStudio issue? Thanks for your help!!!</p>