I'm trying to knit chunks that contain errors into an HTML file but without printing the errors — just the chunk.
While trying to solve this, I learned interesting information such as :
- Hiding the result of a chunk that doesn't contain errors
- Prettying the error
- Preventing chunk evaluation
I also found :
and
While this was useful information for further analysis, I still don't get how to print the chunk without getting the error.
Lets' say I want the following code to be printed in the HTML file, but not the error :
Actual code looks like this (keep in mind that I erased the initial part of the R code so you can see the code) :
include=TRUE, echo=TRUE, message=FALSE, warning=FALSE, error=TRUE, results='hide', warn.conflicts=FALSE}
ggplot(df, aes(y = ABC, x = 123)) +
geom_point()