My First Closeread

Graphical poems with ggplot2.


```{r walkthrough, include = T}
ggplot(cars) +
  aes(x = speed, y = dist) +
  geom_point() +
  geom_smooth()
```
ggplot(cars) +
  aes(x = speed, y = dist) +
  geom_point() +
  geom_smooth()

knitr::knit_code$get("walkthrough")
cr_last_plot_construction <- ':::{focus-on="cr-.PLOTXXX"}\n.COMMENT, `.CODE`\n:::\n\n:::{#cr-.PLOTXXX}\n```{r .PLOTXXX}\n.LEADING\n  .CODE\n```\n:::\n'  
knitr::knit_code$get("walkthrough") |>
  str_remove("\\s*?\\+$") |>
  tibble(code = _) |>
  mutate(index = row_number()) |>
  mutate(plot_name = paste("walkthrough", sep = "-", index)) |>
  mutate(explosion = cr_last_plot_construction) |>
  mutate(explosion = str_replace_all(explosion, ".PLOTXXX", plot_name)) |>
  mutate(explosion = str_replace(explosion, ".COMMENT", "")) |>
  mutate(explosion = str_replace_all(explosion, ".CODE", code)) |>
  mutate(explosion = str_replace(explosion, ".LEADING", ifelse(index == 1, "", "last_plot() +"))) |>
  pull(explosion) |>
  cat(sep = "\n") ->
to_closeread

:::{focus-on="cr-walkthrough-1"}
, `ggplot(cars)`
:::

:::{#cr-walkthrough-1}
```{r walkthrough-1}

  ggplot(cars)
```
:::


:::{focus-on="cr-walkthrough-2"}
, `  aes(x = speed, y = dist)`
:::

:::{#cr-walkthrough-2}
```{r walkthrough-2}
last_plot() +
    aes(x = speed, y = dist)
```
:::


:::{focus-on="cr-walkthrough-3"}
, `  geom_point()`
:::

:::{#cr-walkthrough-3}
```{r walkthrough-3}
last_plot() +
    geom_point()
```
:::


:::{focus-on="cr-walkthrough-4"}
, `  geom_smooth()`
:::

:::{#cr-walkthrough-4}
```{r walkthrough-4}
last_plot() +
    geom_smooth()
```
:::