set_downstream_recursive: Recursively set downstream stations

Description Usage Arguments Examples

Description

recursively sets all stations downstream of a target station

Usage

1
set_downstream_recursive(station, table, next_downstream, set_to = 1)

Arguments

station

target station to set

table

a data.table describing upstream / downstream relationships between stations.

next_downstream

the next station downstream of the target station

set_to

toggle between setting upstream (1) or not upstream(0)

Examples

1
2
3
4
5
M  <- initialize_matrix_from_stations(c('stn1', 'stn2', 'stn3', 'stn4', 'stn5'))
set_upstream('stn1', M, c('stn2', 'stn3', 'stn4'))
set_upstream('stn2', M, 'stn3')
set_downstream_recursive('stn5', M, 'stn3')
get_downstream('stn5', M)

ECCC-MSC/Basin-Delineation documentation built on June 9, 2019, 7:29 p.m.