Repository navigation
Expand file tree
/
Copy pathREADME.Rmd
More file actions
124 lines (96 loc) · 6.05 KB
/
Copy pathREADME.Rmd
File metadata and controls
124 lines (96 loc) · 6.05 KB
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
---
title: "README"
output:
md_document:
variant: gfm
editor_options:
chunk_output_type: console
---
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "##",
fig.path = "man/figures/README-"
)
```
# loadflex: Models and Tools for Watershed Flux Estimates
The `loadflex` R package implements several of the most common methods for modeling and
predicting watershed solute fluxes and concentrations, including interpolation
and regression models, period-weighted averaging, and the composite method.
`loadflex` integrates seamlessly with the USGS's
[rloadest](https://code.usgs.gov/water/analysis-tools/rloadest) package and with native R
regression models. It offers a uniform interface for any model type, with which
you can quickly fit models, generate predictions, and aggregate to monthly or
annual values.
To see the recommended citation for this package, please run `citation('loadflex')` at the R prompt.
```{r eval=TRUE}
citation('loadflex')
```
## Installation
To install the `loadflex` package, use the `remotes` package as follows.
You will need a compiler to install `smwrStats`, `smwrQW`, and `rloadest` -- for Windows, see https://cran.r-project.org/bin/windows/Rtools/rtools43/rtools.html. For Mac, see https://mac.r-project.org/tools/.
```{r eval=FALSE}
# install.packages("remotes") # run if needed
remotes::install_gitlab("water/analysis-tools/smwrData", host = "code.usgs.gov")
remotes::install_gitlab("water/analysis-tools/smwrBase", host = "code.usgs.gov")
remotes::install_gitlab("water/analysis-tools/smwrGraphs", host = "code.usgs.gov")
remotes::install_gitlab("water/analysis-tools/smwrStats", host = "code.usgs.gov") # needs compilation
remotes::install_gitlab("water/analysis-tools/smwrQW", host = "code.usgs.gov") # needs compilation
remotes::install_github("USGS-R/rloadest") # needs compilation
remotes::install_github("appling/unitted")
remotes::install_github("DOI-USGS/EGRET")
remotes::install_github("DOI-USGS/loadflex", build_vignettes=TRUE)
```
Credentials, if needed: `loadflex` and its dependencies are all on public websites, so you _shouldn't_ need to create any Personal Access Tokens (PATs), but sometimes it seems to help anyway, depending on your network and account settings.
If you encounter errors in accessing code.usgs.gov or github.com in any of the above `remotes::` commands:
* to use `remotes::install_gitlab()` you _may_ need to create and store a [GitLab PAT](https://docs.gitlab.com/auth/tokens/fine_grained_access_tokens) for the USGS GitLab instance at code.usgs.gov (https://code.usgs.gov/-/user_settings/personal_access_tokens).
* to use `remotes::install_github()` you _may_ need to create and store a [GitHub PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) for github.com (https://github.com/settings/personal-access-tokens).
The currently [recommended method](https://usethis.r-lib.org/articles/git-credentials.html#put-your-pat-into-the-local-git-credential-store) for storing your PATs within R is to call `gitcreds::gitcreds_set()` and enter the PATs you established on the GitLab and GitHub websites.
```{r eval=FALSE}
# install.packages("gitcreds") # run if needed
gitcreds::gitcreds_set(url = 'https://code.usgs.gov') # enter your code.usgs.gov GITLAB_PAT value (begins with `glpat_`) at the interactive prompt
gitcreds::gitcreds_set() # enter your GITHUB_PAT value (begins with `ghp_`) at the interactive prompt
```
Also please see the installation FAQ on the wiki
(https://github.com/DOI-USGS/loadflex/wiki/Installation-FAQ) if you run into trouble.
## Getting Started
To get started, load the package with `library(loadflex)` and type `?loadflex` or
`vignette('intro_to_loadflex', package = 'loadflex')`.
The vignette is also viewable at https://doi-usgs.github.io/loadflex/articles/intro_to_loadflex.html.
## Development and Maintenance Status
Project funding has ended and our maintenance time is limited,
but we do attempt to provide bug fixes and lightweight support
as we are able. Submit questions or suggestions to
[https://github.com/DOI-USGS/loadflex/issues](https://github.com/DOI-USGS/loadflex/issues).
## Contributing
We want to encourage a warm, welcoming, and safe environment for contributing to this project.
See [CODE_OF_CONDUCT.md](https://github.com/DOI-USGS/loadflex/blob/main/CODE_OF_CONDUCT.md) for more information.
For technical details on how to contribute,
see [CONTRIBUTING.md](https://github.com/DOI-USGS/loadflex/blob/main/CONTRIBUTING.md)
## Development History
`loadflex` was created 2013-2015 by [Alison Appling](https://github.com/aappling-usgs)
and [Miguel Leon](https://github.com/miguelcleon) with the support of [Bill
McDowell](https://colsa.unh.edu/faculty/mcdowell) and the [McDowell
lab](http://wrrc.unh.edu/mcdowell-lab-current) at the University of New
Hampshire. Funding for the project was provided by the National
Science Foundation, USDA National Institute of Food and Agriculture, and the NH
Agricultural Experiment Station. Funding for the example dataset from the
Lamprey River was provied by the EPA, NH Water Resources Research Center, NH
Agricultural Experiment Station, NH Sea Grant, USGS, and NSF.
Additional development and maintenance in 2016-2017 was done by
[Alison Appling](https://github.com/aappling-usgs),
[Lindsay Platt](https://github.com/lindsayplatt), and
[David Watkins](https://github.com/wdwatkins) with support from the USGS National Water Quality Program and the USGS Office of Water Information.
## Model Archive
The following version of R and package dependencies were used most recently to pass the
embedded tests within this package. There is no guarantee of reproducible results using
future versions of R or updated versions of package dependencies; however, we aim to test
and update future modeling environments.
```{r echo=FALSE}
suppressPackageStartupMessages(library(loadflex))
info_txt <- capture.output(sessioninfo::session_info())
clean_txt <- info_txt[!grepl("(^ \\[)|(^ pandoc)|(^ quarto)", info_txt)]
cat(clean_txt, sep = '\n')
```
```{r disclaimer, child="DISCLAIMER.md", eval=TRUE}
```