Reputation: 379
I have main .rmd file, that does nothing except calls two rmarkdown::render() functions to create file1 and file2. It does it great, however it opens up .pdf reader with empty file as there are no results or reports provided from main. How to turn it off from popping up, when I press Knit button? Best case would be to prevent it from creating main.pdf and pop-up.
```{r SuperChunck, echo = FALSE, include = FALSE}
rmarkdown::render(input = "F:/file1.Rmd", encoding = "UTF-8",
output_file = paste0("file1, ".pdf"),
output_dir = PathResult)
rmarkdown::render(input = "F:/file2.Rmd", encoding = "UTF-8",
output_file = paste0("file2, ".pdf"),
output_dir = PathResult)
```
Upvotes: 0
Views: 467
Reputation: 6483
If I understand your question correctly you are kniting
the main .Rmd file which contains the code you are showing in the question? If there is no report produced by the code in the main .Rmd file, then there is no reason to have it as a .Rmd file. Put the code above in a 'normal' .R script (of course without the
```{r SuperChunck, echo = FALSE, include = FALSE}
and
```
parts) and run the script by executing it, sourcing it or calling it from a command line.
Upvotes: 1