R-Report - Saving

LabKey Support Forum
R-Report - Saving marcia hon  2018-02-27 08:33
Status: Closed
 
I have the following:

```{r setup, echo=FALSE, cache=TRUE, results='hide', warning=FALSE, comment=FALSE, warning=FALSE, message=FALSE, encoding = 'UTF-8',comments = ""}
knitr::opts_chunk$set(echo=FALSE, cache=TRUE, comment=FALSE, comments = "", warning=FALSE, eval = TRUE, encoding = "native.enc")
knitr::pandoc('script.Rmd', format='html')
```

```{r, echo=FALSE, cache=TRUE, results='hide', warning=FALSE, comment=FALSE, warning=FALSE, message=FALSE, encoding = 'UTF-8',comments = ""}
currentdir <- getwd()
assign("html_filename", paste(currentdir, "/script.html", sep=""))
assign("out_filename", paste("/directory/@files/Reports/Results/Report_", format(Sys.time(), "%Y-%m-%d_%H:%M:%S"), ".html", sep=""))
file.copy(from = html_filename, to = out_filename)
system("rm script.* *.tsv")
```

This code sometimes saves the file and sometimes does not save the file. Is there a way to force it to save always?

Thanks,
Marcia
 
 
marcia hon responded:  2018-02-27 10:48
I found the solution.

Change : cache=TRUE to cache=FALSE

Thanks!