-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
163 lines (126 loc) · 6.62 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
---
title: "ReadMe"
output: md_document
always_allow_html: yes
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
<!-- rmarkdown::render(input="README.Rmd", output_file = "README.md", output_format = "md_document") -->
```{r, echo = FALSE, message = FALSE, warning = FALSE}
library(dplyr)
library(tidyr)
library(knitr)
library(kableExtra)
library(RegionalCurve)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
<img src="man/figures/rc-3-logo.png" width="250" align="right"/>
# RegionalCurve
An R Package of Hydraulic Regional Curve Relationships
## Package Status
<!-- badges: start -->
[![LifeCycle](https://img.shields.io/badge/lifecycle-stable-green)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![packageversion](https://img.shields.io/badge/Package%20version-0.1.7-orange.svg?style=flat-square)](commits/master)
[![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub('-', '--', Sys.Date())`-yellowgreen.svg)](/commits/main)
[![Licence](https://img.shields.io/badge/licence-CC0-blue.svg)](http://choosealicense.com/licenses/cc0-1.0/)
[![Dependencies](https://img.shields.io/badge/dependencies-7/24-orange?style=flat)](#)
[![License: CC0](https://img.shields.io/badge/License-CC0-lightgrey.svg)](https://choosealicense.com/licenses/cc0-1.0/)
[![codecov](https://codecov.io/gh/FluvialGeomorph/RegionalCurve/graph/badge.svg?token=ITOTR1Y9OX)](https://codecov.io/gh/FluvialGeomorph/RegionalCurve)
<!-- badges: end -->
## Need
Regional hydraulic dimension relationships have been produced in great
numbers since the first development of the approach by Dunne and Leopold
(1978). Although these regional relationships are in wide use, the
authors are not aware of a comprehensive compilation of regional
hydraulic dimension relationship studies into a single database that
exists as open source. The `RegionalCurve` package seeks to fill that
gap by:
- Compiling regional hydraulic relationships into a single database.
- Providing assessor functions to streamline application of these
relationships in other studies.
<img src="man/figures/HDQLO-03_h120.jpg" width="125" align="right"/>
## Funding
Funding for development and maintenance of FluvialGeomorph has been
provided by the following US Army Corps of Engineers (USACE) programs:
- [Ecosystem Management and Restoration Research Program
(EMRRP)](https://emrrp.el.erdc.dren.mil).
- [Regional Sediment Management Program
(RSM)](https://rsm.usace.army.mil/)
- [Mississippi River Geomorphology and Potamology Program
(MRG&P)](https://www.mvd.usace.army.mil/Missions/Mississippi-River-Science-Technology/MS-River-Geomorphology-Potamology/)
- [Flood Risk Management Program
(FRM)](https://www.iwr.usace.army.mil/Missions/Flood-Risk-Management/Flood-Risk-Management-Program/)
<img src="man/figures/FRMP_300.png" height="75" align="right"/><img src="man/figures/MRG&P_300.png" height="75" align="right"/><img src="man/figures/RSMlogo.png" height="75" align="right"/><img src="man/figures/EMRRP_logo_300.png" height="75" align="right"/>
## Authors
- Michael Dougherty, Geographer, U.S. Army Corps of Engineers
<div itemscope itemtype="https://schema.org/Person"><a itemprop="sameAs" content="https://orcid.org/0000-0002-1465-5927" href="https://orcid.org/0000-0002-1465-5927" target="orcid.widget" rel="me noopener noreferrer" style="vertical-align:top;"><img src="https://orcid.org/sites/default/files/images/orcid_16x16.png" alt="ORCID iD icon" style="width:1em;margin-right:.5em;"/>https://orcid.org/0000-0002-1465-5927</a></div>
- Christopher Haring, Fluvial Geomorphologist/Research Physical
Scientist, U.S. Army Corps of Engineers
## Install
To install the `RegionalCurve` package, install from GitHub using the
`devtools` package:
``` r
library(devtools)
install_github(repo = "FluvialGeomorph/RegionalCurve", build_vignettes = TRUE)
```
## Vignettes
View the vignettes to get started using the package.
``` r
# View the vignettes in a web browser
browseVignettes("RegionalCurve")
# Open a specific vignette in the RStudio help window
vignette("Get_Regional_Hydraulic_Dimensions")
```
## Calculating Hyrdaulic Dimensions
To easily use the data in this database several assessor functions were
created to calculate an estimate of a specified hydraulic dimension for
any given drainage area. The `RHG` (Regional Hydraulic Geometry)
function computes the hydraulic geometry dimension (cross sectional
area, width, depth, discharge) from a built-in data frame of regional
hydraulic equation coefficients (`regional_curve`).
``` r
# Calculate the discharge for a 200 sq mi watershed in Massachusetts.
RHG(region = "MA", drainageArea = 200, dimensionType = "width")
```
The units of the value returned from the `RHG` function will depend on
the requested dimension (see the `RHG` function help for details). In
this case, the requested dimension was `width`, so the units will be in
feet.
To determine which regions are available, the `regional_curve` data
frame can be queried.
``` r
# Determine the available regions
levels(regional_curve$region_name)
```
This list of regions can be used to determine which regions are
contained in the database and the input `region` string value to use for
the `RHG` function.
Once you have determined which region to use, you will need to determine
which dimensions that study derived a relationship for. Not all studies
derive relationships for all hydraulic dimensions.
``` r
# Determine which dimensions were calculated for the Eastern United States region
regional_curve[regional_curve$region_name == "Eastern United States", c("dimension")]
```
As you can see, only area, width, and depth are available. Discharge was
not derived by this study.
## Regional Analyses Contained in this Database
The table below lists the regional hydraulic dimension relationship
studies included in this package. It lists the dimensions calculated for
each regional analysis.
```{r list_regions, echo=FALSE, fig.cap="Regional Hydraulic Dimension by Drainage Area Studies Included in this Package.", message = FALSE, warning = FALSE}
# Create a summary table describing dimensions available for each region
regional_curve %>%
spread(key = dimension, value = slope) %>%
group_by(region_name, reference) %>%
summarise(width = any(width > 0),
depth = any(depth > 0),
area = any(area > 0),
discharge = any(discharge > 0)) %>%
kable(col.names = c("Region","Reference","Width","Depth","Area","Discharge")) %>%
kable_styling(bootstrap_options = c("striped", "hover"))
```