knitr::opts_chunk$set(
  dpi = 300,
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  warning = FALSE,
  message = FALSE 
)

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)

Get downstream and upstream nodes of a given node

fun_downstream_nodes(g, 8)
fun_upstream_nodes(g, 2)


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