Learn R Programming

gRbase (version 1.7-5)

graph-coercion: Coercion of graphs

Description

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

Usage

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

Arguments

object
A graphNEL object
result
Either "matrix" or "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. as.adjMAT is the same as graphNEL2M (and is retained for backward compatibility).

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)
uG <- ug(~me:ve + me:al + ve:al + al:an + al:st + an:st)

getCliques(uG)

uG.m <- graphNEL2M(uG)
getCliques( uG.m )

ug.M <- graphNEL2M(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