-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
69 lines (54 loc) · 1.96 KB
/
README.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
# Predicting and Visualizing Thermal Habitat: `thermopic`
The `thermopic` R package provides functionality for predicting and visualizing the seasonal availability of thermal habitat in lakes.
## Installation
Installation is easiest from an `R` commandline using the `devtools` package.
```{r, eval=FALSE}
devtools::install_github('stevencarlislewalker/thermopic')
```
It might be necessary to preceed this first step by installing `devtools`.
```{r, eval=FALSE}
install.packages('devtools')
```
Once the package is installed, it may be loaded using the `library` function.
```{r}
library(thermopic)
```
## Quick tour
The `thermopic` package runs within a project directory, which we create using the optional `temporary_thermopic_directory` function.
```{r}
root = temporary_thermopic_directory()
```
We now use `thermopic`'s `setup_directory` function to create the required directory structure for our project. For this quick tour we use sample input data contained within the package, which is the default behaviour of `setup_directory`.
```{r}
setup_directory(root, overwrite = TRUE)
```
To inspect the resulting directory structure one may use `thermopic`s `print_directory_tree` function.
```{r}
print_directory_tree(root)
```
Now that the structure is in place one may fit the thermopic model.
```{r}
fitted_thermopic_model = thermopic_model(
path = root,
Lake = '1_Lake.csv',
Climate = '2_Climate.csv'
)
```
And create the report as well as the thermopic images themselves.
```{r}
thermopic_report_data = thermopic_report(
path = root,
STM_Parameters = '4_STM_Parameters.csv',
Nlakes_test = 5,
show_progress_bar = FALSE
)
```
Here we see the resulting outputs including the images in `jpeg` format files.
```{r, echo=FALSE}
print_directory_tree(root)
```
```{r, echo=FALSE}
unlink(root)
```
## Further information
For a more detailed introduction see this [tutorial](inst/doc/thermopic_tutorial.md).