---
title: "test_project"
filters: 
 - webr
webr:
  packages: ['ggplot2', 'dplyr']
---

## Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.

```{webr-r}
1 + 1
```

```{webr-r}
library(ggplot2)

gapminder <- read.csv("https://www.ggplot2-uncharted.com/data/gapminder-2022.csv")

ggplot(gapminder, aes(x = gdp_pcap, y = life_exp)) +
  geom_point(
    aes(fill = fertility, size = pop), 
    shape = 21, color = "grey20"
  ) +
  # pre-defined ColorBrewer palette, optionally change direction
  scale_fill_distiller(
    palette = "YlGnBu", # pick option
    direction = -1 # reverse gradient?
  ) +
  scale_x_log10() +
  scale_size(range = c(2, 12), guide = "none") +
  labs(x = "GDP per capita (int$, log)", y = "Life Expectancy (years)", fill = "Fertility rate") +
  theme_light()
```