# Import rivers
rivers_in <- import_rivers(yamaska_rivers, quiet = TRUE)
# Correct errors automatically
rivers_cor <- enforce_dendritic(rivers_in, correct = TRUE)
# Return highlighted topological errors for manual correction
rivers_uncor <- enforce_dendritic(rivers_in, correct = FALSE)
# For large river networks it may be better to specify a smaller number of
# correction sweeps.
rivers_cor <- enforce_dendritic(rivers_in, correct = TRUE, max_iter = 3)
Run the code above in your browser using DataLab