I am trying to generate a large number of html files using rmarkdown::render
in a loop, with Parameterized reports.
After generating a number of files, it stalls, and I have to restart RStudio. I can generate each individual file in itself; it is not at the same file it stalls each time when I try running the loop.
There is no error message, making it hard for me to debug.
I have tried the following, none of which helped:
- Closing all other programs; reducing the memory used.
- Adding
knitr::knit_meta(clean = TRUE)
before render
- Adding
clean = T
inside render
- Calling
render
with callr::r
- Including
rm([[data]]); gc()
at the end of the .rmd file that is called by render
Any other ideas of how to try and solve this issue?
question from:
https://stackoverflow.com/questions/66049032/rmarkdownrender-loop-stalls-after-a-few-iterations 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…