Description Usage Arguments Examples
, given the next-upstream and next-downstream stations, set all up- and downstream stations as appropriate.
1 | set_relative_position(station, table, next_upstream, next_downstream)
|
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. |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.