import_rivers: Prepare rivers for connectivity analyses

View source: R/import.R

import_riversR Documentation

Prepare rivers for connectivity analyses

Description

Reads and prepares geospatial river line data for use in river_net(). Only the largest fully connected component of the network is retained; river lines that are part of disconnected secondary networks are discarded.

Usage

import_rivers(rivers, quiet = FALSE)

Arguments

rivers

A character string specifying the path to a shapefile of river lines, or an sf object representing river geometries.

quiet

Logical. If FALSE (default), plots the imported river lines in black over the original lines in red so that removed rivers are highlighted.

Value

An object of class rivers, suitable for use with enforce_dendritic() or as input to river_net().

Examples

rivers_in <- import_rivers(yamaska_rivers)

# This can also be done quietly to omit plotting river lines after importing
rivers_in <- import_rivers(yamaska_rivers, quiet = TRUE)

dci documentation built on June 14, 2025, 1:08 a.m.