Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

graph-coerce

Graph coercion


Description

Methods for changing graph representations

Usage

coerceGraph(object, class)

graph_as(object, outtype, intype = NULL)

Arguments

object

A graph object

class

The desired output class

outtype

The desired output outtype

intype

The desired output outtype (only relevant if object is a list)

Details

coerceGraph is used in the book "Graphical models with R". A more generic approach is as().

Examples

g1 <- ug(~a:b+b:c)
as(g1, "igraph")
as(g1, "matrix")
as(g1, "Matrix")
as(g1, "dgCMatrix")

## graph_as(g1, "ugList") ## Fails
## getCliques(g1)         ## Works

l1 <- list(c("a" ,"b"), c("b", "c"))
graph_as(l1, "graphNEL", "ugList")

gRbase

A Package for Graphical Modelling in R

v1.8-6.7
GPL (>= 2)
Authors
Søren Højsgaard <sorenh@math.aau.dk>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.