Bill Length V.S. Body Mass
library(ggplot2)
library(palmerpenguins)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.1
## ✔ lubridate 1.9.3 ✔ tibble 3.2.1
## ✔ purrr 1.0.2 ✔ tidyr 1.3.1
## ── 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
ggplot(data = penguins)+
geom_point(mapping = aes(x=bill_length_mm, body_mass_g, color=species))+
facet_wrap(~species)+
labs(title = "Bill Length V.S. Body Mass (All gender)")
## Warning: Removed 2 rows containing missing values or values outside the scale range
## (`geom_point()`).

library(ggplot2)
library(palmerpenguins)
library(tidyverse)
penguins_male <- penguins %>% filter(sex == "male")
ggplot(data = penguins_male)+
geom_point(mapping = aes(x=bill_length_mm, body_mass_g, color=species))+
facet_wrap(~species)+
labs(title = "## Bill Length V.S. Body Mass (Male)")

library(ggplot2)
library(palmerpenguins)
library(tidyverse)
penguins_female <- penguins %>% filter(sex == "female")
ggplot(data = penguins_female)+
geom_point(mapping = aes(x=bill_length_mm, body_mass_g, color=species))+
facet_wrap(~species)+
labs(title = "Bill Length V.S. Body Mass (Female)")+
annotate("text",x=50, y=3000, label="Similar Results", color="purple", font="bold")
## Warning in annotate("text", x = 50, y = 3000, label = "Similar Results", :
## Ignoring unknown parameters: `font`
