2016-08-26 05:44:14 +08:00
|
|
|
---
|
2023-05-25 23:43:06 +08:00
|
|
|
format: html
|
2016-08-26 05:44:14 +08:00
|
|
|
params:
|
|
|
|
my_class: "suv"
|
|
|
|
---
|
|
|
|
|
2022-10-22 06:12:48 +08:00
|
|
|
```{r}
|
|
|
|
#| label: setup
|
|
|
|
#| include: false
|
|
|
|
|
|
|
|
library(tidyverse)
|
2016-08-26 05:44:14 +08:00
|
|
|
|
2022-02-24 03:15:52 +08:00
|
|
|
class <- mpg |> filter(class == params$my_class)
|
2016-08-26 05:44:14 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
# Fuel economy for `r params$my_class`s
|
|
|
|
|
2022-10-22 06:12:48 +08:00
|
|
|
```{r}
|
|
|
|
#| message: false
|
|
|
|
|
2022-12-05 16:12:12 +08:00
|
|
|
ggplot(class, aes(x = displ, y = hwy)) +
|
2016-08-26 05:44:14 +08:00
|
|
|
geom_point() +
|
|
|
|
geom_smooth(se = FALSE)
|
|
|
|
```
|