调用 rmarkdown::render 时接收器已满 [英] Sink is full when calling rmarkdown::render

查看:87
本文介绍了调用 rmarkdown::render 时接收器已满的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注 这个简短的教程 将我的 R 脚本直接打印为 HTML 文档.它应该非常简单.对其他正常 R 脚本的标题和注释进行一些小的更改,调用命令rmarkdown::render('/Users/you/Documents/yourscript.R') 在 R 脚本的末尾应该调用 knitr::spin 函数从我的 R 脚本到一个 Rmd 文件到最终的 HTML 或 PDF.

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.

我收到错误:接收器错误(con,split = debug):接收器堆栈已满,我不知道该怎么做.我在网上找到的所有解决方案都指出,打开它们后需要关闭 sink().但是由于我自己并没有真正使用 sink(),所以我不知道应该如何或在哪里关闭它们.

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.

我使用的是 R 3.3.0.

I'm using R 3.3.0.

这个问题提出了相同的问题,但投反对票,没有答案.

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

推荐答案

好吧,结果证明我做了一些愚蠢的事情:我包含了命令 rmarkdown::render('/Users/you/Documents/yourscript.R') 在我的脚本中,忘记将其注释掉.我可能结束了无限递归.我评论了那条线,它运行得很好.

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!

这篇关于调用 rmarkdown::render 时接收器已满的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆