-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoral-bleaching-eda.Rmd
58 lines (49 loc) · 1.22 KB
/
coral-bleaching-eda.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
---
title: "Coral Bleaching EDA"
author: "Alejandro Hernandez"
date: "`r Sys.Date()`"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
# clear workspace
rm(list = ls())
# load relevant libraries
library(tidyverse)
library(knitr)
library(rigr)
```
```{r data-loading}
coral <- read.csv("data/coral-bleaching.csv")
coral.data.dictionary <- read.csv("data/coral-bleaching-data-dictionary.csv")
coral.data.dictionary %>% kable
```
```{r data-summary}
# island means
coral %>%
select(Island_Name, PctCoralFullyBleached_mean) %>%
group_by(Island_Name) %>%
summarise(mean = mean(PctCoralFullyBleached_mean))
# boxplots
coral %>%
ggplot(aes(y = PctCoralFullyBleached_mean, x = Island_Name,
color = Island_Name)) +
geom_boxplot() +
geom_jitter(width = 0.2)
# histograms
coral %>%
ggplot(aes(x = PctCoralFullyBleached_mean, fill = Island_Name)) +
geom_histogram() + facet_wrap(vars(Island_Name))
```
```{r}
# plot long v. lat
coral %>%
ggplot(aes(x = Longitude_mn, y = Latitude_mn,
color = Island_Name)) +
geom_point()
coral %>%
ggplot(aes(x = Longitude_ras, y = Latitude_ras,
color = Island_Name)) +
geom_point()
```
**End of document.**