library(ggplot2)
library(palmerpenguins)
Using tabs in Quarto
Let’s create 3 charts for the penguins
dataset:
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()
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()
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()