I want to make a presentation in which I demo which error messages are show when you run invalid R code. Printing the code and the error message. However, this will obviously break the Markdown report itself. Is there a setting for code chunks or reports in general that prints the error message instead of breaking the knitting of the report.
Here is a small reprex of something that should print the error instead of breaking the report:
Adding a character to a numeric yields the following error:
```{r}
x <- 2
x + "4"
```