简体   繁体   English

Rmarkdown - 在文档中运行代码并显示错误

[英]Rmarkdown - Run code and display errors in document

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. 我在运行下面的代码时收到错误消息 - 我希望在pdf中运行并显示,但是在r中返回错误并且代码不会运行。

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

I have tried warning=TRUE but this doesn't work. 我试过warning=TRUE但这不起作用。

How can I get the error displayed in the document? 如何获取文档中显示的错误?

Add error=TRUE to the chunk options. error=TRUE添加到块选项。 That will result in the script running to completion with the error appearing in the output. 这将导致脚本运行完成,并在输出中显示错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM