travCount: Count # of nodes connected to root node

Description Usage Arguments Value See Also Examples

Description

Count doesn't include root node. Simpler version of travOut. Might be faster? Developed for a different project.

Usage

1
travCount(g, root, orderN = -1, vmode = "out")

Arguments

g

igraph object

root

character string: name of root node

orderN

number, # of degrees away from root node to search. Default is -1 which searches all degrees

vmode

character string: 'out', 'in' or 'all', determines how to subgraph g from root. Default is 'out'.

Value

number, count of nodes connected to root node.

See Also

travOut

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
require('igraph')

## build sample network
from <- c('A','A','B','B','C','C','D','D','E','E','E','F','F','H','L','L','O')
to <- c('B','C','D','E','F','G','H','I','J','J','K','L','G','M','N','O','P')
relations<-cbind(from,to)
g <- graph.data.frame(relations)
tiers <- c(1,2,3,4,1,3,4,2,1,2,3,4,0,0,1,2)
V(g)$tier <- tiers

plot(g)
travCount(g, 'B')
travCount(g, 'L', vmode='out')

brooksandrew/Rsenal documentation built on May 13, 2019, 7:50 a.m.