
Last chance! 50% off unlimited learning
Sale ends in
get.incidence(graph, types=NULL, attr=NULL, names=TRUE, sparse=FALSE)
type
type
NULL
or a character string giving an edge
attribute name. If NULL
a traditional incidence matrix is
returned. If not NULL
then the values of the given edge
attribute are included in the incidence mTRUE
and the vertices in the
graph are named (i.e. the graph has a vertex attribute called
name
TRUE
then a sparse
matrix is created, you will need the Matrix
package for this.type
FALSE
for the vertices of the first
kind and TRUE
for vertices of the second kind.The vertex ids corresponding to rows and columns in the incidence matrix are returned as row/column names.
graph.incidence
for the opposite operation.g <- graph.bipartite( c(0,1,0,1,0,0), c(0,1,1,2,2,3) )
get.incidence(g)
Run the code above in your browser using DataLab