Learn R Programming

gRbase (version 1.7-1)

graph-coercion: Coercion of graphs

Description

Coercion of graphs from graphNEL format to dense or sparse adjacency matrix formats etc.

Usage

as.adjMAT(object, result="matrix")
graphNEL2M(object, result="matrix")
graphNEL2MAT(object, limit=100)
graphNEL2ftM(object)
graphNEL2matrix(object)
graphNEL2dgCMatrix(object)

Arguments

object
A graphNEL object
result
Either "matrix" of "Matrix" (or equivalenty "dgCMatrix") for a sparse matrix representation.
limit
If the number of nodes is larger than limit the matrix will be sparse; otherwise dense.

Details

Notice: graphNEL2M(g, result="matrix") and graphNEL2M(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)

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

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

graphNEL2ftM( uG )
graphNEL2tfM( uG )

graphNEL2M( uG )
graphNEL2matrix( uG )
graphNEL2dgCMatrix( uG )
graphNEL2MAT( uG )
graphNEL2MAT( uG, limit=4 )

Run the code above in your browser using DataLab