-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
127 lines (90 loc) · 3.75 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---
title: "Hobotemp"
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Hobotemp
This is for managing and understanding your HOBO temperature data. This will work on any HOBO data that has been downloaded in csv format (not hproj format).
## Requirements
+ [R v4+](https://www.r-project.org/)
+ [dplyr](https://CRAN.R-project.org/package=dplyr)
+ [readr](https://CRAN.R-project.org/package=readr)
+ [stringr](https://CRAN.R-project.org/package=stringr)
+ [ggplot2](https://CRAN.R-project.org/package=ggplot2)
+ [lubridate](https://CRAN.R-project.org/package=lubridate)
## Installation
```
remotes::install_github("rfrancolini/hobotemp")
```
## Function: read_hobotemp()
This function will take in raw hobotemp data and output a csv. Options include whether you want to define a site name (if not, itll pull it from the file name), if you want to define the start/stop times, have it automatically remove the first and last day (default setting), or keep all of the data, and if you want to write a file with a specific output name.
### Read Example Data
```{r example}
library(hobotemp)
x <- read_hobotemp()
x
```
### Read Example Data with User Defined Site
``` {r exampleSiteName}
library(hobotemp)
x <- read_hobotemp(site = "Little Drisko Island")
x
```
### Read Example Data With User Defined Start/Stop Dates
```{r exampleStartStop}
ss <- as.POSIXct(c("2021-05-20", "2021-06-01"), tz = "UTC")
xud <- read_hobotemp(clipped = "user", startstop = ss)
xud
```
## Function: summarize_hobotemp()
Create a dataframe summarizing the temperature data, will group by site.
### Summarize data, csv with one site
```{r ldSummary}
sum1 <- summarize_hobotemp(x)
print.data.frame(sum1)
```
### Summarize data, csv with more than one site
```{r msSummary}
sum2 <- summarize_hobotemp(example_ridge_data())
print.data.frame(sum2)
```
## Function: draw_scatter_plot()
This function will read in a csv of your HOBO data and draw a scatter plot with an overlapping trendline.
### Draw Example Scatter Plot
```{r tempplot, message=FALSE}
tempplot_x <- draw_scatter_plot(x)
tempplot_x
```
### Draw Example Scatter Plot with User Defined Start/Stop Dates and Title
```{r tempplot_ud, message=FALSE}
tempplot_xud <- draw_scatter_plot(xud, main = "Temperature at Depth, End of May")
tempplot_xud
```
## Function: draw_ridgeline_plot()
This function will create a color-coded ridgeline plot, adapted from [here](https://r-graph-gallery.com/294-basic-ridgeline-plot.html). This will have a line representing the temperature, as well as the space underneath the line colored in using a temperature gradient color scheme. Sites will appear in order they are in dataframe, unless "ordered" option is used.
### Draw example ridgeline plot
```{r ridgeline, message = FALSE}
ridgelineplot <- draw_ridgeline_plot()
ridgelineplot
```
### Draw example ridgeline plot with specified site order (south to north)
```{r ridgelineOrdered, message = FALSE}
SiteOrder <- c("Cape Liz", "Halfway Rock", "Damariscove", "Isle Au Haut", "Marshall")
ridgelineplotO <- draw_ridgeline_plot(ordered = SiteOrder)
ridgelineplotO
```
## Function: draw_line_plot()
This function will create a line plot, with a colorblind friendly color pallette, and can currently take up to 15 sites at once. Sites will appear in legend (or will be facetted upon) in order they are in dataframe, unless "ordered" option is used.
### Draw example line plot
```{r line, message = FALSE}
lineplot <- draw_line_plot()
lineplot
```
### Draw example line plot facetted with specified site order (south to north)
```{r lineOrdered, message = FALSE}
SiteOrder <- c("Cape Liz", "Halfway Rock", "Damariscove", "Isle Au Haut", "Marshall")
lineplotO <- draw_line_plot(ordered = SiteOrder, facet = "Site")
lineplotO
```