README.md

CoRiverNF

R-CMD-check

A data only R package containing natural flow data for the Colorado River Basin. Data is included at the natural flow basin node level used by the Colorado River Simulation (CRSS).

The package is a convenient way to access the Colorado River Natural Flow data available here. Every effort will be made to update the package to include the most recent natural flow data.

The package is based on the 1906-2020 natural flow data with a date of April 19, 2023.

Installation

The data can be accessed by installing this package from GitHub:

# install.packages("remotes")

remotes::install_github("BoulderCodeHub/CoRiverNF", build_vignettes = TRUE)

Note that when installing from GitHub, warnings are treated as errors. This means if xts is built under a newer version of R than you have installed, then the installation of CoRiverNF will fail. You can resolve this by either installing the newer version of R, or by setting the R_REMOTES_NO_ERRORS_FROM_WARNINGS environment variable to "true" before installation.

Using in R

The package includes monthly, calendar year, and water year data for total and intervening natural flow in 6 data sets:

You can easily access these data using natural flow node abbreviated names, and the methods used by xts objects to subset time series data. For example, the 2000-2015 data at Lees Ferry can be accessed with cyAnnTot$LeesFerry['2000/']. For more examples see the vignette: vignette("CoRivNatFlow", package = "CoRiverNF").

Reproducing the Data

The included data can be recreated by downloading the package code, or copying the code and Excel file located in data-raw.

To run the code, edit the path to the Excel file located in the "User Input" section of the getHistoricalNFData.R file and then source that file.

Log



BoulderCodeHub/CoRiverNF documentation built on April 28, 2023, 4:15 a.m.