Network directory as working directory - R Notebook plots do not get rendered

rnotebook

#1

Hi All,

Is there a way to get plots rendered within .nb.html when I have network directory as my working directory? I currently have all .Rmd and .Rproj files within a network directory in my organization and I access those from my Windows 7 PC. I am simply using the default notebook that's generated within RStudio . I have R-3.4.1 installed on my C:drive and I have tried this with both RStudio 1.1.442 & 1.1.456 versions.

plot(cars) output plot does not get shown in the .nb.html file when I have the network directory as working directory. I tried using a local directory (a temp folder on C:drive) as working directory and I see the plot gets rendered fine. By searching on stackoverflow and RStudio community I tried setting up root.dir within setup chunk (knitr::opts_knit$set(root.dir = file.path("C:\Rtmp)) - although working directory gets changed I still do not see the plot getting rendered within .nb.html file when I click on 'Preview' button.

I also notice that the plot gets rendered within 'Plots' pane within Rstudio despite 'Chunk Output Inline' being checked within settings.

Please also note that the plot gets rendered fine when I have output set to html_document.

Any insights on how to get R Notebook to display the plots within .nb.html file with my current setup? What exactly is the function behind 'Preview' button in RStudio. Is there any other option to set a local directory as working directory and essentially have the plot displayed within .nb.html file?

Thanks for your help!