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 |