-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
95 lines (76 loc) · 3.35 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
---
output: github_document
editor_options:
chunk_output_type: console
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE, message=FALSE}
library(manager)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```
[](https://travis-ci.org/jentjr/manager)
[](https://ci.appveyor.com/project/jentjr/manager/branch/master)
[](https://codecov.io/github/jentjr/manager?branch=master)
## Overview
The goal of manager is to provide a set of tools to simplify plotting and
analyzing environmental data that is in a [tidy format](https://cran.r-project.org/web/packages/tidyr/vignettes/tidy-data.html). Manager also provides
functions to read data from external sources such as MANAGES and gINT.
## Example
```{r, eval = FALSE}
library(manager)
# reading data from external sources
data <- read_manages3("C:/path/to/Site.mdb")
```
```{r, time-series, fig.height=6, fig.width=9, results='hide', warning=FALSE}
# load example data and plot time series of selected wells and constituents
data("gw_data")
wells <- c("MW-1", "MW-2")
params <- c("Magnesium, dissolved",
"Sodium, dissolved",
"Chloride, total",
"Sulfate, total",
"Potassium, dissolved")
gw_data %>%
filter(location_id %in% wells, param_name %in% params) %>%
series_plot(., facet_var = "param_name", group_var = "location_id")
```
```{r boxplots, fig.height=6, fig.width=9, results='hide'}
# create boxplots filled by gradient
gw_data %>%
filter(param_name == "Chloride, total",
location_id %in% c("MW-1", "MW-2", "MW-3", "MW-4", "MW-5", "MW-6", "MW-7", "MW-8")) %>%
mutate(gradient = if_else(location_id %in% wells, "upgradient", "downgradient")) %>%
boxplot(., fill = "gradient")
```
Piper Diagrams and more...
```{r, piper-plot, fig.height=6, fig.width=9, results='hide', warning=FALSE}
gw_data %>%
piper_plot()
```
## Installation
To install the `manager` package you must first make sure you have a working
development environment.
* **Windows**: Install [Rtools](http://cran.r-project.org/bin/windows/Rtools/).
* **Mac**: Install Xcode from the Mac App Store.
* **Linux**: Install a compiler and various development libraries (details vary across differnet flavors of Linux).
Then, install the `remotes` package from CRAN with
```R
install.packages("remotes")
```
After you have `remotes` installed you can install `manager` using the command
```R
remotes::install_github("jentjr/manager")
```
Eventually, the package might be submitted to CRAN, but until then you'll have
to install with `remotes`.
## Shiny App
A [shiny app](http://shiny.rstudio.com) is included with the package. It can
be launched locally by running `manager::manager()`, or you can browse to the
[shinyapps.io](http://shinyapps.io) website for
[manager](http://jentjr.shinyapps.io/manager). In order to read a MANAGES, or
gINT database you must be running a local server with `RODBC` installed.
`R` must either be in 32-bit, or 64-bit mode depending on which drivers are installed for microsoft access. MANAGER has only been tested in 32-bit mode.