I am trying to knit a Store-Metrics.Rmd file so as to generate the reports in a webpage. The code is fine. When I run it, I can see the dashboard but when I try to knit so as to push it through the webpage, I get the following error:
Line 135: Error in file(con, "w"): cannot open the connection
Calls:<Anonymous...block_cache-><Anonymous> ->write_utf8 ->writelines -?file
In addition: Warning message:
In file(con."w")"
cannot open file 'Store-Metrics_cache/html/_packages':Permission denied
Execution halted.
The folder Store-Metrics_cache exists. It is located in the following:
/srv/shiny-server/Store/Store_report/Store-Metrics_cache
I checked line 135 and this is what it looks like
{r, echo=False, warning=False, message=False, cache=TRUE, cache.extra=file.info("srv/shiny-server/Store/Store_Report/Storedata.RData")$mtime}
CurrentMonthStatistics("Tota")
LastYearGraph("Total")
Any help on how I could get the dashboard to load unto the webpage would be greatly appreciated.
Thank you
I first tried to get my working directory. I ran
getwd()
and it gave me "/"
I also ran the .libPaths()
and the results are below
"/home/john/R/X86_64-pc-linux-library/4.1"
"/usr/local/lib/R/site-library"
"/usr/lib/R/site-library"
"/usr/lib/R/library
I also went to the global options to check the directory there and it shows the following:
Default working directory(when not in a project):
~/R
I also cleared Knitr Cache, restarted R studio then re-run the codes and knit to tml_document:default but I still get the same error.