FlowConnectionMatrix: Object of class 'FlowConnectionMatrix'

View source: R/gr_flowConnectionInput.R

FlowConnectionMatrixR Documentation

Object of class FlowConnectionMatrix


It creates an object of class FlowConnectionMatrix. Such an object is used as an input to create subsets based on the criterion of flow connectedness. See Vignette "Subsets and Coordinates". Within a subset all nodes will be flow connected.


FlowConnectionMatrix(x, g)



should be a matrix of ones and zeros, 1 representing flow connectedness between node i and node j. The matrix should have named rows and columns. Note that x is symmetric.


is an igraph object representing the graph. It should have named vertices.


An object of class FlowConnectionMatrix containing the matrix of flow connection.


# create a graph and name the vertices
g<- graph(c(1,2,3,2, 2,4,4,5), directed=TRUE)
g<- set.vertex.attribute(g, "name", V(g), letters[1:5])

# create the flow connection matrix if not available
x<- matrix(rep(1,25), 5, 5)
x[1,3]<- x[3,1]<- 0
colnames(x)<- rownames(x)<- letters[1:5] # columns and rows are named according to the nodes

# create the object of class 'FlowConnectionMatrix'
fcmat<- FlowConnectionMatrix(x,g)
rds<- FlowConnect()
sets<- subset(rds, from = fcmat, g)

gremes documentation built on Feb. 16, 2023, 8:06 p.m.