-
Notifications
You must be signed in to change notification settings - Fork 0
/
TapajosConv.Rmd
47 lines (39 loc) · 1.14 KB
/
TapajosConv.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
---
title: "Tapajos_Conv"
author: "Ellery Vaughan"
date: "2023-09-27"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Tapajos Conversion
```{r reading in data}
library(tidyverse)
data_raw <- read.csv("../../NCEAS_SPARC/TG07_km83_Tapajos_P_McGroddy control direct only.csv")
```
```{r converting from stocks to concentrations}
# adding depth
data <- data_raw %>%
mutate(depth = "0_10") %>%
select(collection:core, depth, everything()) %>%
mutate(bulk_density = as.numeric(bulk_density))
# columns to convert
# P_NaHCO3
# P_NaOH
# P_1M_HCl
# P_conc_HCl
# P_H2SO4
# Come back and correct this
# data_converted <- data %>%
# mutate(across(.cols = c(P_NaHCO3, P_NaOH, P_1M_HCl, P_conc_HCl, P_H2SO4), .fns = (./bulk_density)*10^3))
data_converted <- data %>%
mutate(P_NaHCO3 = ((P_NaHCO3/bulk_density)*10^3),
P_NaOH = (( P_NaOH/bulk_density)*10^3),
P_1M_HCl = ((P_1M_HCl/bulk_density)*10^3),
P_conc_HCl = ((P_conc_HCl/bulk_density)*10^3),
P_H2SO4 = ((P_H2SO4/bulk_density)*10^3))
```
```{r export data}
write_csv(data,"../Tapajos_McGroddy_Silver.csv")
```