We are interested in the relationship between flipper length and bill length for different penguin species.
We will use the tidyverse package for data wrangling, the palmerpenguins package to obtain the data, and the DT package for interactive display of tabular output.
library(tidyverse)
library(palmerpenguins)
library(DT)
These data were collected and made available by Dr. Kristen Gorman and the Palmer Station, Antarctica LTER, a member of the Long Term Ecological Research Network. The dataset can be accessed after loading the palmerpenguins package.
ggplot(penguins,
mapping = aes(x = flipper_length_mm, y = bill_length_mm, color = species)) +
geom_point() +
geom_smooth(method = "lm") +
labs(
title = "Flipper and bill length",
subtitle = "Dimensions for Adelie, Chinstrap, and Gentoo Penguins at Palmer Station LTER",
x = "Flipper length (mm)",
y = "Bill length (mm)"
)
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 2 rows containing non-finite values (stat_smooth).
## Warning: Removed 2 rows containing missing values (geom_point).
Below is the full dataset: