-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.qmd
More file actions
49 lines (40 loc) · 1.05 KB
/
Copy pathindex.qmd
File metadata and controls
49 lines (40 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
title: "Using tabs in Quarto"
format: html
editor: visual
css: style.css
---
Let's create 3 charts for the `penguins` dataset:
```{r}
library(ggplot2)
library(palmerpenguins)
```
::: {.panel-tabset .nav-pills}
## Scatterplot
```{r, warning=FALSE}
ggplot(penguins, aes(x = flipper_length_mm, y = body_mass_g, color = species)) +
geom_point() +
labs(title = "Flipper Length vs Body Mass by Species",
x = "Flipper Length (mm)",
y = "Body Mass (g)") +
theme_minimal()
```
## Boxplot
```{r, warning=FALSE}
ggplot(penguins, aes(x = species, y = bill_length_mm, fill = species)) +
geom_boxplot() +
labs(title = "Bill Length Distribution by Species",
x = "Species",
y = "Bill Length (mm)") +
theme_minimal()
```
## Barplot
```{r, warning=FALSE}
ggplot(penguins, aes(x = species, y = body_mass_g, fill = species)) +
geom_bar(stat = "summary", fun = "mean") +
labs(title = "Average Body Mass of Penguin Species",
x = "Species",
y = "Average Body Mass (g)") +
theme_minimal()
```
:::