-
Notifications
You must be signed in to change notification settings - Fork 4
/
penguins_report.Rmd
69 lines (56 loc) · 2.1 KB
/
penguins_report.Rmd
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: "Gentoo Penguins"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE,
message = FALSE,
warning = FALSE)
library(tidyverse)
library(readxl)
```
## About the data
The **Palmer Penguins** data were collected and made available by Dr. Kristen Gorman and the [Palmer Station, Antarctica LTER](https://pal.lternet.edu/), a member of the Long Term Ecological Research Network. The data set includes several characteristics from Adelie, Chinstrap and Gentoo penguins.
```{r read}
penguins <- read_csv("data/penguins.csv")
summary <- penguins %>%
group_by(species) %>%
summarise(count = n(),
mean_body_mass = round(mean(body_mass_g/1000, na.rm = TRUE), 2))
summary %>%
knitr::kable(col.names = c("Specie", "Count", "Mean Body Mass"),
align = "lcc",
caption = "Summary of penguins on the data set by species.")
```
### Gentoo penguins
On this section we focus the analysis on the Gentoo species. The bill length is positively correlated with bill depth, penguins with longer bills usually have deeper bills.
```{r}
penguins %>%
filter(species == "Gentoo") %>%
ggplot(aes(x = bill_length_mm, y = bill_depth_mm)) +
geom_point(color = "darkorange",
size = 3,
alpha = 0.8) +
geom_smooth(method = "lm", se = FALSE, color = "darkorange") +
theme_minimal() +
labs(title = "Penguin bill dimensions",
subtitle = "Bill length and depth for Gentoo Penguins at Palmer Station LTER",
x = "Bill length (mm)",
y = "Bill depth (mm)",
color = "Penguin species")
```
Female and male penguins have differnet body mass. Male penguins generally are bigger than females.
```{r}
penguins %>%
filter(species == "Gentoo") %>%
ggplot(aes(x = body_mass_g)) +
geom_histogram(aes(fill = sex),
alpha = 0.5,
position = "identity") +
scale_fill_manual(values = c("darkorange", "cyan4")) +
theme_minimal() +
labs(x = "Body mass (g)",
y = "Frequency",
fill = NULL,
title = "Penguin body mass")
```