forked from karinneff/CSP2020_workflow_project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMockReport.Rmd
40 lines (31 loc) · 1.2 KB
/
MockReport.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
---
title: "Mock Report"
output:
html_document:
keep_md: yes
---
```{r setup, include=FALSE, warning = FALSE}
knitr::opts_chunk$set(echo = FALSE)
library(tidyverse)
library(skimr)
```
Preliminary investigation into zoo animal life expectancy.
I will assess taxon overal and sex-specific life expectancy.
```{r echo=FALSE, eval = TRUE, warning = FALSE}
zooAnimals <- read.csv("zooAnimal_medianLifeExpectancy_Jul2018 .csv", header = TRUE)
skim(zooAnimals)
```
```{r eval = TRUE, echo=FALSE, warning = FALSE}
zooAnimalSum <- zooAnimals %>%
group_by(TaxonClass) %>%
summarise(medMLE_all = median(Overall.MLE, na.rm = TRUE),
medMLE_male = median(Male.MLE, na.rm = TRUE),
medMLE_female = median(Female.MLE, na.rm = TRUE)) %>%
gather(mle_group, medMLE, medMLE_all:medMLE_female)
ggplot(zooAnimalSum, aes(TaxonClass, medMLE, fill = mle_group)) +
geom_col(position = "dodge") +
coord_flip() + theme_bw(14) +
labs(title = "Median Life Expectancy by Taxon and Sex", x = "", y = "Median Life Expectancy (years)", fill = "")
```
#I'd like to compare with wild median life expectancy
In summary, Amphibia have the shortest median life spans in zoos. Only female aracnida were recorded.