Learn R Programming

natcpp (version 0.2)

c_EdgeListFromSegList: Turn a segment list into an edgelist suitable for constructing an ngraph

Description

Turn a segment list into an edgelist suitable for constructing an ngraph

Usage

c_EdgeListFromSegList(L)

Value

An integer matrix of N rows and 2 columns

Arguments

L

a list containing integer vectors from as.seglist

Details

It is up to the caller to generate the seglist. Note that isolated points will be dropped since they have no edges.

Examples

Run this code

if (FALSE) {
library(nat)
# make a neuron with multiple subtrees
n=prune_vertices(Cell07PNs[[1]], 48L)
# Must use flatten=T if including all subtrees
sl=as.seglist(n, all = TRUE, flatten = TRUE)
c_EdgeListFromSegList(sl)
}

Run the code above in your browser using DataLab