powered by
Generates a toid attribute from node topology by joining tonode and fromnode attributes.
add_toids(x, return_dendritic = TRUE)# S3 method for data.frame add_toids(x, return_dendritic = TRUE)# S3 method for hy add_toids(x, return_dendritic = TRUE)
# S3 method for data.frame add_toids(x, return_dendritic = TRUE)
# S3 method for hy add_toids(x, return_dendritic = TRUE)
hy object with toid attribute
data.frame network compatible with hydroloom_names.
logical remove non dendritic paths if TRUE. Requires a "divergence" flag where 1 is main and 2 is secondary.
Required attributes: fromnode, tonode
fromnode
tonode
Conditionally: divergence (if return_dendritic = TRUE)
divergence
return_dendritic = TRUE
g <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom")) x <- add_toids(hy(g)) y <- add_toids(g) names(g)[1:4] names(x)[1:4] names(y)[1:4]
Run the code above in your browser using DataLab