-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathADC_RMarkdown_Practice.Rmd
95 lines (62 loc) · 2.12 KB
/
ADC_RMarkdown_Practice.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
title: "ADC_Practice"
author: "Ellie Honan"
date: "2023-02-28"
output: html_document
---
*The below code chunk is handy for setting default options for each chunk\
All packages should go here*
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(readr)
```
## 1. Introduction
**\<BODY BGCOLOR="BLUE"\>**
This data set contains North Pole Environmental Observatory Bottle Chemistry data.
This data set includes diverse measurements of seawater chemistry along with supporting conductivity, temperature, and depth (CTD) data from the Arctic Ocean near the North Pole. Measurements were taken from sea ice platforms each April or May from 2000-2014.
[Link to data](https://arcticdata.io/catalog/view/doi:10.18739/A25T3FZ8X)
**\</BODY BGCOLOR="BLUE"\>**
### 2. Read Data
```{r loading in the csv}
bg_chem <- read_csv("data/BGchem2008data.csv")
```
```{r exploration, echo=FALSE, eval = FALSE}
#eval = false is to not show the output in the output
colnames(bg_chem)
#this shows the columns a little bit of what's in each
str(bg_chem)
head(bg_chem)
```
## 3. Analysis
### Calculate summary statistics
```{r summary stats}
nitrate <- mean(bg_chem$NO3)
nitrite <- mean(bg_chem$NO2)
amm <- mean(bg_chem$NH4)
phos <- mean(bg_chem$P)
```
### Calculate mean Redfield ratio
```{r stats}
ratio <- (nitrate + nitrite + amm)/phos
```
The Redfield ratio in this data set is approximately `r round(ratio)`
### Plot Redfield ratio
```{r plot, echo=FALSE}
#this shows the plot but not the code
plot(bg_chem$P, bg_chem$NO2 + bg_chem$NO3 + bg_chem$NH4)
```
### R Scripts vs RMarkdown discussion
<FONT COLOR="#ff0000"> You could write a report </FONT COLOR="#ff0000"> with markdown - but functions etc would go in a script.
<style>
div.blue pre { background-color:lightblue; }
#div.blue pre.r { background-color:blue; }
</style>
<div class = "blue">
```{r bluecars}
plot(bg_chem$P, bg_chem$NO2 + bg_chem$NO3 + bg_chem$NH4)
```
Example text with blue background
</div>
# Notes from day 2 session 1
## Git and GitHub
Merging branches is analogous to accepting a change in Word’s Track Changes feature but way more powerful and useful.