Sink is full when calling rmarkdown::render

旧街凉风 提交于 2020-12-03 05:28:14

问题


I'm following this short tutorial to print my R script directly as an HTML document. It should be pretty straightforward. With a few small changes to the header and comments of an otherwise normal R script, calling the command rmarkdown::render('/Users/you/Documents/yourscript.R') at the end of an R script should call the knitr::spin function to go from my R script to an Rmd file to the final HTML or PDF.

I'm getting the error: Error in sink(con, split = debug) : sink stack is full and I'm not sure what to do. All solutions I've found online point out that one needs to close sink()'s after opening them. But since I'm not really using sink() myself, I don't see how or where I should close them.

I'm using R 3.3.0.

This Question asks the same but is downvoted and has no answers.


回答1:


Well, it turned out I was doing something stupid: I included the command rmarkdown::render('/Users/you/Documents/yourscript.R') within my script and forgot to comment it out. I probably ended doing an infinite recursion. I commented that line out and it worked beautifully.

Hope this helps others not be as silly!



来源:https://stackoverflow.com/questions/38455703/sink-is-full-when-calling-rmarkdownrender

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!