问题
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