set_relative_position: Set relative position of station

Description Usage Arguments Examples

Description

, given the next-upstream and next-downstream stations, set all up- and downstream stations as appropriate.

Usage

1
set_relative_position(station, table, next_upstream, next_downstream)

Arguments

station

target station for which upstream-downstream relations are to be set

table

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

next_upstream

(optional) the next station upstream of the target station. If omitted, no upstream stations will be set.

next_downstream

(optional) the next station downstream of the target station. If omitted, no upstream stations will be set.

Examples

1
2
3
4
5
6
7
M  <- initialize_matrix_from_stations(c('stn1', 'stn2', 'stn3', 'stn4','stn5'))
set_upstream('stn1', M, c('stn2', 'stn3', 'stn4'))
set_upstream('stn2', M, c('stn3', 'stn4'))
set_upstream('stn3', M, 'stn4')
set_relative_position('stn5', M, next_upstream='stn3', next_downstream='stn2')
get_upstream('stn5', M)
get_downstream('stn5', M)

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