Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

calculate_total_drainage_area

Total Drainage Area


Description

Calculates total drainage area given a dendritic network and incremental areas.

Usage

calculate_total_drainage_area(x)

Arguments

x

data.frame with ID, toID, and area columns.

Value

numeric with total area.

Examples

library(dplyr)
source(system.file("extdata", "walker_data.R", package = "nhdplusTools"))
catchment_area <- select(walker_flowline, COMID, AreaSqKM) %>%
  right_join(prepare_nhdplus(walker_flowline, 0, 0,
                            purge_non_dendritic = FALSE, warn = FALSE), by = "COMID") %>%
  select(ID = COMID, toID = toCOMID, area = AreaSqKM)

new_da <- calculate_total_drainage_area(catchment_area)

catchment_area$totda <- new_da
catchment_area$nhdptotda <- walker_flowline$TotDASqKM

mean(abs(catchment_area$totda - catchment_area$nhdptotda))
max(abs(catchment_area$totda - catchment_area$nhdptotda))

nhdplusTools

NHDPlus Tools

v0.4.0
CC0
Authors
David Blodgett [aut, cre], Mike Johnson [ctb] (<https://orcid.org/0000-0002-5288-8350>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.