README.md

A few functions used for creating and manipulating dendritic networks, mainly wrappers for various igraph functions.

Installation

# devtools::install_github("flee598/DenMet")
library(DenMet)

Create a dendritic network with 10 nodes

nwk <- DenMet::fun_crtNwk2(10, 0.5)
nwk2 <- igraph::graph.adjacency(nwk)
fun_pltNwk(nwk2, direct = "out", edge.arrow.size = 2)

Downstream network, hide arrows

nwk <- DenMet::fun_convert_nwk(nwk, "dwn_adj")
g <- igraph::graph.adjacency(nwk)
fun_pltNwk(g, "in", edge.arrow.size = 0)

get strahler order of graph nodes

fun_strahler_order(g)
#>  [1] 2 2 2 2 1 2 1 2 1 1

Get downstream and upstream nodes of a given node

fun_downstream_nodes(g, 8)
#> [1] 1 2 3 4 6
fun_upstream_nodes(g, 2)
#> [1]  3  4  5  6  7  8  9 10


flee598/DenMet documentation built on Nov. 3, 2021, 6:57 a.m.