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?
Chunk options The initial line in a code chunk may include various options. For example, echo=FALSE indicates that the code will not be shown in the final document (though any results/output would still be displayed). You use results="hide" to hide the results/output (but here the code would still be displayed).
There are two ways to render an R Markdown document into its final output format. If you are using RStudio, then the “Knit” button (Ctrl+Shift+K) will render the document and display a preview of it. Note that both methods use the same mechanism; RStudio's “Knit” button calls rmarkdown::render() under the hood.
You can insert an R code chunk either using the RStudio toolbar (the Insert button) or the keyboard shortcut Ctrl + Alt + I ( Cmd + Option + I on macOS).
Add error=TRUE
to the chunk options. That will result in the script running to completion with the error appearing in the output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With