Skip to contents

This function will extract all segments between 2 IDs (ID_ini and ID_fin) or with a name (name_river), arrange them from upstream to downstream and add where confluences ask in confluence_toAdd are positioned on the profile.

Usage

TNETutils_getLongProfile(
  troncons,
  ID_ini = NULL,
  ID_fin = NULL,
  name_river = NULL,
  confluence_toAdd = NULL,
  columns_keep = NULL
)

Arguments

troncons

data.frame. Segments created by TNET_createShape()

ID_ini

number. ID of the first segment of the profile. Can be NULL if name_river is set.

ID_fin

number. ID of the last segment of the profile. Can be NULL if name_river is set.

name_river

string. Name of the river to plot the longitudinal profile. Only if troncons have the column "TopoOH".

confluence_toAdd

vector. Can be the name of confluences rivers to pin if troncons have the column "TopoOH". It can also be a vector of segments ID.

columns_keep

vector. Name of the columns to keep in the data.frame troncons.

Value

data.frame with the longitudinal profile

Examples


troncons_River <- TNETutils_getLongProfile(...)
#> Error: '...' used in an incorrect context

confluences <- TNETutils_getLongProfileConfluence(troncons_River,y='LongProfile')
#> Error: object 'troncons_River' not found

ggplot(data = troncons_River, aes(x=L_Upstream,y=LongProfile))+
  geom_vline(xintercept = confluences$X, color = 'grey')+
  annotate(geom="label", x=confluences$X, y=confluences$Y, label=confluences$LABEL, angle=90,hjust = 0,fill='white',size = 3)+
  geom_line()
#> Error: object 'troncons_River' not found