-
Notifications
You must be signed in to change notification settings - Fork 0
/
rmd-intro.Rmd
50 lines (37 loc) · 1010 Bytes
/
rmd-intro.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
---
title: "Markdown lesson"
author: "Peter"
date: "11/13/2020"
output:
pdf_document: default
html_document: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
library(readr)
```
# Introduction
This is a short training segment in which we will be calculating the Redfield ratio for a small estuary in Alaska based on oceanographic data collected in 2008.
```{r message=FALSE, warning=FALSE}
bg_chem <- read_csv("BGchem2008data.csv")
```
# Analysis
* calculate summary statistics
```{r}
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}
ratio <- (nitrate + nitrite + amm)/phos
```
The Redfield ratio for this dataset is approximately `r round(ratio)`.
* plot Redfield ratio
```{r, echo = FALSE}
plot(bg_chem$P, bg_chem$NO2 + bg_chem$NO3 + bg_chem$NH4)
```
Data downloaded from [Arctic Data Center](https://arcticdata.io/catalog/view/doi:10.18739/A25T3FZ8X)