x <- data.frame(
id = c(1, 2, 3, 4, 5, 6, 7, 8, 9),
toid = c(2, 3, 4, 5, 0, 7, 8, 9, 4)
)
# 1 -> 2 -> 3 -> 4 -> 5
# ^
# |
# 6 -> 7 -> 8 -> 9
#
# Dendritic tree: all flowlines are bridges
get_bridge_flowlines(x)
Run the code above in your browser using DataLab