Rmarkdown - Run code and display errors in document

China☆狼群 提交于 2019-12-21 07:39:09

问题


I get an error message when running the code below which is expected - I would like this to be ran and displayed in the pdf, however the error is returned in r and the code doesn't run.

{r, warning=TRUE} library(survey) debug(withReplicates.svyrep.design)

I have tried warning=TRUE but this doesn't work.

How can I get the error displayed in the document?


回答1:


Add error=TRUE to the chunk options. That will result in the script running to completion with the error appearing in the output.



来源:https://stackoverflow.com/questions/34137797/rmarkdown-run-code-and-display-errors-in-document

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