── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.0 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
First look at Palmer Penguins
Data visualization and transformation
Data Science with R
Introduction
How do bill sizes of penguins vary across species? And what happens if we don’t take species into consideration?
Packages
We will use the tidyverse packages for data wrangling and visualization and the palmerpenguins package for the data.
Data
The dataset we will visualize is called penguins
. Let’s glimpse()
at it.
# add code here
Penguin bills
- Create a scatterplot of
bill_depth
vs.bill_length
s ofpenguin
s. Overlay a line of best fit. Describe the relationship between the two variables.
# add code here
Add interpretation here.
- Create a scatterplot of
bill_depth
vs.bill_length
s ofpenguin
s, colored byspecies
. Overlay a line of best fit. Describe the relationship between the two variables for each of the species.
# add code here
Add interpretation here.
- Reflect on the seemingly contradictory findings from the two visualizations you’ve created. Which one do you believe more, and why?