is_dendritic: Is the network dendritic?

View source: R/hy_classes.R

is_dendriticR Documentation

Is the network dendritic?

Description

Checks whether the network contains any divergences. Returns FALSE if a divergence column exists with any value of 2, or if the table has a toid column and duplicated id values (indicating row duplication from divergences). Otherwise returns TRUE.

Usage

is_dendritic(x, validate_data = TRUE)

Arguments

x

data.frame or hy object to test.

validate_data

logical. If FALSE, only checks the divergence column (fast). If TRUE (default), also checks for duplicated ids.

Value

logical. TRUE if the network is dendritic.

Examples

x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
is_dendritic(hy(x))


hydroloom documentation built on Aug. 4, 2026, 1:07 a.m.