# load example rvh file
nith <- system.file("extdata","Nith.rvh",package = "RavenR")
rvh <- rvn_rvh_read(nith)
# plot full watershed with igraph library
plot(rvh$SBnetwork)
# query all subbasins upstream of basin 39, plot
rvh_upstream_of_39 <- rvn_rvh_query(rvh, subbasinID=39, condition="upstream_of")
plot(rvh_upstream_of_39$SBnetwork)
# query of HRUs downstream of basin 39
rvn_rvh_query(rvh, subbasinID=39, condition="downstream_of")$SBtable
Run the code above in your browser using DataLab