knitr::opts_chunk$set(echo = FALSE
                      , results = 'asis'
                      , warning = FALSE
                      , message = FALSE)

Purpose

The BCG calculator requires the inclusion of Index Name and Index Class fields in the input file (otherwise the R code won’t know which BCG rules to apply). The PNMR BCG model has three BCG classes based on gradient and elevation:

During BCG model development, gradient and elevation information were derived from the following sources:

Elevation and gradient data are difficult for some users to access. We added this function to make that step easier. It utilizes R tools from StreamCatTools and nhdplusTools to populate elevation and % slope based on the latitude and longitude coordinates in the input file.

Generate Index Class Parameters Workflow{width=80%}

Input File

The following fields are required:

If you named the required fields differently in your input file, it’s ok. Click on the drop-down menus. The list of fields in your input file will appear. Select the correct column headings.

All columns in the input file are carried over into the output file.

Disclaimers

The StreamCat R tools that are used to match your sites with the NHDPlusV2 stream segment identifiers (COMIDs) do not have QC measures. At a minimum, we recommend the following checks:

Depending on the size of your input file, this function may several minutes to run (e.g., 5-10 minutes). Be patient. There is a lot going on behind the scenes. If you streamline your input file and only include station information (vs. station + macroinvertebrate data), it will run faster. You can then use the ‘Merge Files’ function to join the macroinvertebrate + stations data.

The StreamCatTools function sc_get_comid uses the nhdplusTools function discover_nhdplus_id which utilizes a nearest neighbor search. Using the nhdplusTools function get_flowline_index will return results in a table instead of a vector but will include a distance measure. The function requires additional inputs and has a warning that it may fail when employed over a wide area. Thus it was not practical to implement in this Shiny app.

Test File

Click here to download a test file.

Click here to download example R scripts and data (all functions).


Last updated 2023-06-08



leppott/BCGcalc documentation built on May 17, 2024, 5:55 p.m.