-
Notifications
You must be signed in to change notification settings - Fork 0
/
introduction.qmd
55 lines (38 loc) · 2.44 KB
/
introduction.qmd
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
---
title: Introduction
execute:
eval: false
---
## Background
Denitrification is the natural process by which nitrate (NO~3~^-^) in the soil are converted by bacteria into nitrous oxide (N~2~O) or pure nitrigen (N~2~). The latter is called *total denitrification* --- the full process described in @eq-denitrification takes place.
$$
\ce{NO3^- ->[\text{Nitrate}][\text{reductase}] NO2^- ->[\text{Nitrite}][\text{reductase}] NO ->[\text{Nitrite oxide}][\text{reductase}] N2O^- ->[\text{Nitrous oxide}][\text{reductase}] N2}
$${#eq-denitrification}
Denitrification occurs in conditions where oxygen is limited, such as waterlogged soils. It is part of the nitrogen cycle, where nitrogen is circulated between the atmosphere, organisms and the earth.
## Installation of the R package PRE
All functions that are used repeatedly throughout this projec are implemented in an R package called `PRE`. The source code of this package is stored in a [publically accessible way on GitHub](https://github.com/Damian-Oswald/PRE). You can install the package directly from GitHub using the `install_github` function from the `remotes` package.
```{r}
install.packages("remotes")
remotes::install_github("https://github.com/Damian-Oswald/PRE")
```
Alternatively, you could download the GitHub repository and manually install the `PRE` package locally.
Once the package is installed, you can attach it to the search path in the usual way.
```{r}
#| eval: true
#| message: false
library(PRE)
```
### What do the various functions do?
The R code shown on this project help page is extremely simplified. If you want want to understand what a specific function of the `PRE` package does, simple visit the corresponding R help page. For example, you could read on the function `crossValidate` by using one of the the following commands.
```{r}
help("crossValidate", package = "PRE")
?crossValidate
```
If you want to jump really deep into a function, you could print it out in your console.
```{r}
#| eval: true
print(crossValidate)
```
Note this function source code output is lacking any comments. Those were automatically removed when compiling the R package. To see the commented source code, you'll have to jump into the package files, or visit the GitHub page. Simply use the following URL:
<https://github.com/Damian-Oswald/PRE/blob/main/R/crossValidate.R>
Notice how the base name (the last part of the URL) matches the function name. You can replace that by any function name of your liking.