I’m writing a Quarto document and trying to deliberately trigger an error in R for demonstration purposes. I’ve noticed that it works as expected until I place it inside a callout block.
I am just wondering why does this happen, and how can I get it to work within a callout?
---
title: "Example"
format:
html:
embed-resources: true
---
Create an example data frame:
```{r}
deck <- data.frame(face = c("king", "queen", "jack"),
value = 13:11)
```
:::{.callout-danger}
R will return an error if you try to pair a negative integer with a positive integer in the same index:
```{r}
#| error: true
deck[c(1, -1), ]
```
:::
:::{.callout-warning}, here it says "Note that there are five types of callouts, including:note,tip,warning,caution, andimportant.". quarto: 1.5.57, rmarkdown: 2.29, knitr: 1.48.