::: {.cell hash='02_R_introduction_cache/pdf/unnamed-chunk-119_7ceb35fdaf2839b25c82b9eed511b405'}

```{.r .cell-code}
my_vec <- c(1.0, 3.14, 5.42)

if (is.numeric(my_vec)) {
  mean(my_vec)
} else {
  # Signal an error and stop execution
  stop("We are expecting a numeric vector!")
}
```

::: {.cell-output .cell-output-stdout}
```
[1] 3.186667
```
:::
:::