Learn R Programming

gRbase (version 1.6-12)

graph-coercion: Coercion of graphs

Description

Coercion of graphs from graphNEL format to adjacency matrix format and to other formats

Usage

as.adjMAT(object, result="matrix")
graphNEL2adjMAT(object, result="matrix")
graphNEL2ftM(object)
graphNEL2matrix(object)
graphNEL2dgCMatrix(object)

Arguments

object
A graphNEL object
result
Either "matrix" of "Matrix" (for a sparse matrix representation).

Details

Notice: graphNEL2adjMAT(g, result="matrix") and graphNEL2adjMAT(g, result="Matrix") do the same as as(g, "matrix") and as(g, "Matrix") but considerably faster.

See Also

edgeList getCliques nonEdgeList mcs rip moralize jTree

Examples

Run this code
uG <- ug(~me:ve,~me:al,~ve:al,~al:an,~al:st,~an:st)
getCliques(uG)

amat1 <- as.adjMAT(uG)
getCliques(amat1)

amat1 <- as.adjMAT(uG, result="Matrix")
getCliques(amat1)

Run the code above in your browser using DataLab