Based on a parent-child table, this returns a vector of column names to help create a consistent capture history matrix. By default, it will sort using the paths constructed from `buildNodeOrder()`. If river kilometer (`rkm`) is included as a column in the configuration file, this function could use that to help determine the column order.
defineCapHistCols(
parent_child = NULL,
configuration = NULL,
use_rkm = FALSE,
bottom_sites = NULL,
incl_all_nodes = TRUE
)
parent-child table. Could be created from `buildParentChild()` from `PITcleanr` package.
configuration file. Could be created from `buildConfig()` from `PITcleanr` package.
if the river kilometer code exists in the configuration file (in a column named `rkm`), use those codes to help establish the order of capture history columns. Default value is `FALSE`.
If provided, represents a character vector of sites to use as "bottom sites". All upstream sites of each bottom site will be grouped just after that bottom site in the capture history matrix.
if some `bottom_sites` are supplied, should all the nodes in the parent-child table be included (default is `TRUE`), or only nodes upstream of those bottom sites be returned (`FALSE`). The initial site will always be returned. If no `bottom_sites` are supplied, this is set to `TRUE`.
defineCapHistCols()
#> Error in addParentChildNodes(parent_child, configuration): !is.null(parent_child) is not TRUE