Introduction: Somewhere in the vast Artic Ocean, a group of penguins resides. These penguins, The Gentoomen, are the most glorius species of penguins to ever grace their home, Biscoe island. When such a magnificent species exists, its the privilege of lower life forms such as myself to analyze these exulted few and ask, how are the Gentoomen doing?
Popultation of Biscoe island: The first step of my analysis of the Gentoomen is to understand their abode, and their population. The Gentoomen live exclusivley on Biscoe island, along with Adelie penguins. Both of these populations experienced a sharp population rise in 2008, and a smaller fall off in 2009. Population growth occurs naturally, but what caused the fall off in 2009?
library(dplyr)
library(tidyverse)
GentoomensClub <- penguins %>%
filter(species == "Gentoo")
Islandboys <- GentoomensClub %>%
count(year, island, species)
barplot(n ~ year,
data = Islandboys,
main="Gentoos on biscoe",
col=rgb(0.2,0.4,0.6,0.6),
xlab="Year",
ylab="Population",
ylim=c(0,50))
library(dplyr)
library(tidyverse)
Islandata <- penguins %>%
count(year, island, species)
AdeleBiscoe <- Islandata %>%
filter(species == "Adelie", island == "Biscoe")
barplot(n ~ year,
data = AdeleBiscoe,
main="Adelies on biscoe",
col=rgb(0.2,0.4,0.6,0.6),
xlab="Year",
ylab="Population",
ylim=c(0,50))
Weight on Biscoe Island: In animal populations, bodymass is often an indicator as to the general health and wellbeing of a species. Coincidentally, this is also true of the Gentoomen. The weight on Biscoe island reveals something intresting. The median body mass of the Gentoomen is falling consistently from 2007 to 2009, but Adelie penguins experienced something different. though they experienced a lower median body between 2007 and 2008, they experienced a drastically higher body weight in 2009. It would be reasonable to assume that the population explosion the penguins experienced in 2008 caused food shortages, which subsquently dropped the average body mass of the population. As penguins migrated away from the island or died, which can be seen in the population data from 2009, the food shortage ended and the penguins should have regained size. This phenomen is apperant in the Adele penguins, so why do the Gentoomen not regain weight?
library(dplyr)
library(tidyverse)
GentoomensClub <- penguins %>%
filter(species == "Gentoo")
boxplot(body_mass_g ~ year,
data = GentoomensClub,
main="Gentoo Body Mass (in g)",
xlab="Year",
ylab="Body Mass (in g)",
col = c('cadetblue', 'brown1', 'darkgoldenrod3'))
AdeleofBiscoe <- penguins %>%
filter(species == "Adelie", island == "Biscoe")
boxplot(body_mass_g ~ year,
data = AdeleofBiscoe,
main="Adelie Body Mass (in g)",
xlab="Year",
ylab="Body Mass (in g)",
col = c('cadetblue', 'brown1', 'darkgoldenrod3'))
Reasons why the Gentoomen are losing weight: It seems most likely that Adelie penguins are better adapted to Biscoe island then Gentoos, which explains why Adelies gained weight in 2009, while the Gentoomen lost weight. With this data, its impossible to tell exactly what trait makes the Adelie more survivable, but we can look at ever observable difference and devise some theories:
1: Adelies short flippers are superior to the Gentoomens rather long flippers 2: The Gentoomens shorter bill depth, though impressive in its own right, is not as survivable as the Adelies bill depth 3: The Gentoomens impressive bill length is actually a survivabilty detrement, unlike the stubby and unimpressive bills of the Adelie 4: The Gentoomens imposing stature and build disadvantages it against the thin and light Adelies
Its impossible to tell, given the data, which of these traits gives the Adelie the edge, but it is quite possibly one of these things. The only question left: is the Age of the Gentoomen over?
# Libraries
library(ggplot2)
GentoomensClub112 <- penguins %>%
filter(species == "Gentoo", species == "Adelie")
# Plot
ggplot(penguins, aes(x=species, y=flipper_length_mm)) +
geom_point()
## Warning: Removed 2 rows containing missing values (`geom_point()`).
ggplot(penguins, aes(x=species, y=bill_depth_mm)) +
geom_point()
## Warning: Removed 2 rows containing missing values (`geom_point()`).
ggplot(penguins, aes(x=species, y=bill_length_mm)) +
geom_point()
## Warning: Removed 2 rows containing missing values (`geom_point()`).
This is just a sampling of all the useless graphs I made trying to figure out what to model:
data(penguins)
summary(penguins)
## species island bill_length_mm bill_depth_mm
## Adelie :152 Biscoe :168 Min. :32.10 Min. :13.10
## Chinstrap: 68 Dream :124 1st Qu.:39.23 1st Qu.:15.60
## Gentoo :124 Torgersen: 52 Median :44.45 Median :17.30
## Mean :43.92 Mean :17.15
## 3rd Qu.:48.50 3rd Qu.:18.70
## Max. :59.60 Max. :21.50
## NA's :2 NA's :2
## flipper_length_mm body_mass_g sex year
## Min. :172.0 Min. :2700 female:165 Min. :2007
## 1st Qu.:190.0 1st Qu.:3550 male :168 1st Qu.:2007
## Median :197.0 Median :4050 NA's : 11 Median :2008
## Mean :200.9 Mean :4202 Mean :2008
## 3rd Qu.:213.0 3rd Qu.:4750 3rd Qu.:2009
## Max. :231.0 Max. :6300 Max. :2009
## NA's :2 NA's :2
summary(penguins_raw)
## studyName Sample Number Species Region
## Length:344 Min. : 1.00 Length:344 Length:344
## Class :character 1st Qu.: 29.00 Class :character Class :character
## Mode :character Median : 58.00 Mode :character Mode :character
## Mean : 63.15
## 3rd Qu.: 95.25
## Max. :152.00
##
## Island Stage Individual ID Clutch Completion
## Length:344 Length:344 Length:344 Length:344
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## Date Egg Culmen Length (mm) Culmen Depth (mm) Flipper Length (mm)
## Min. :2007-11-09 Min. :32.10 Min. :13.10 Min. :172.0
## 1st Qu.:2007-11-28 1st Qu.:39.23 1st Qu.:15.60 1st Qu.:190.0
## Median :2008-11-09 Median :44.45 Median :17.30 Median :197.0
## Mean :2008-11-27 Mean :43.92 Mean :17.15 Mean :200.9
## 3rd Qu.:2009-11-16 3rd Qu.:48.50 3rd Qu.:18.70 3rd Qu.:213.0
## Max. :2009-12-01 Max. :59.60 Max. :21.50 Max. :231.0
## NA's :2 NA's :2 NA's :2
## Body Mass (g) Sex Delta 15 N (o/oo) Delta 13 C (o/oo)
## Min. :2700 Length:344 Min. : 7.632 Min. :-27.02
## 1st Qu.:3550 Class :character 1st Qu.: 8.300 1st Qu.:-26.32
## Median :4050 Mode :character Median : 8.652 Median :-25.83
## Mean :4202 Mean : 8.733 Mean :-25.69
## 3rd Qu.:4750 3rd Qu.: 9.172 3rd Qu.:-25.06
## Max. :6300 Max. :10.025 Max. :-23.79
## NA's :2 NA's :14 NA's :13
## Comments
## Length:344
## Class :character
## Mode :character
##
##
##
##
data(penguins)
ggplot(penguins, aes(x=bill_length_mm, y=body_mass_g)) +
geom_line( color="#69b3a2", size=1, alpha=1, linetype=1)
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: Removed 2 rows containing missing values (`geom_line()`).
data(penguins)
mnf <- penguins %>%
drop_na(sex)
ggplot(data = mnf, aes(x=sex, y=body_mass_g) ) +
geom_bin2d(bins = 70) +
scale_fill_continuous(type = "viridis") +
theme_bw()
data(penguins)
mnf <- penguins %>%
drop_na(sex)
ggplot(mnf, aes(x=sex, y=body_mass_g, fill)) +
geom_violin()
library(dplyr)
library(tidyverse)
mbodyw <- penguins %>%
filter(sex == "male")
ggplot(mbodyw, aes(x=body_mass_g, y=bill_depth_mm)) +
geom_line( color="#69b3a2", size=1, alpha=1, linetype=1)
ggplot(penguins, aes(x=species, y=bill_depth_mm, fill)) +
geom_violin()
## Warning: Removed 2 rows containing non-finite values (`stat_ydensity()`).
ggplot(penguins, aes(x=species, y=bill_length_mm, fill)) +
geom_violin()
## Warning: Removed 2 rows containing non-finite values (`stat_ydensity()`).
ggplot(penguins, aes(x=island, y=body_mass_g, fill)) +
geom_violin()
## Warning: Removed 2 rows containing non-finite values (`stat_ydensity()`).
ggplot(penguins, aes(x=species, y=bill_depth_mm, fill)) +
geom_violin()
## Warning: Removed 2 rows containing non-finite values (`stat_ydensity()`).
ggplot(penguins, aes(x=species, y=bill_length_mm, fill)) +
geom_violin()
## Warning: Removed 2 rows containing non-finite values (`stat_ydensity()`).
ggplot(penguins, aes(x=species, y=body_mass_g, fill)) +
geom_violin()
## Warning: Removed 2 rows containing non-finite values (`stat_ydensity()`).