convert: Convert graph to format associated with specific package

View source: R/Convert.R

convertR Documentation

Convert graph to format associated with specific package

Description

Convert graph to format associated with specific package

Usage

convert(graph, format = "mixedgraph", cur_format, ...)

Arguments

graph

graphical object, of one of classes listed below

format

character string giving new format to convert to

cur_format

character string of current format; can be deduced from the object in many cases

...

other arguments

Details

Possible formats are

  • mixedgraph

  • ggm, an adjacency matrix as specified in the ggm package;

  • graphNEL, graphAM, graphBAM from the graph package;

  • igraph;

  • PAG: that is, the output of pc() or fci() functions in the pcalg package;

  • bn from the bnlearn package;

  • ADMG, from the ADMGs package.

The function can recognise the class of objects other than "ggm", which is just an adjacency matrix.

Implemented natively thus far:

  • mixedgraph <-> ggm

  • mixedgraph <-> ADMG

  • mixedgraph <-> graphNEL

  • mixedgraph <-> graphAM

  • mixedgraph <-> graphBAM

  • mixedgraph <-> PAG

  • mixedgraph <-> bn

  • mixedgraph <-> igraph (goes mixedgraph -> graphNEL -> igraph)

  • graphNEL <-> igraph (using functions in the igraph package)

  • graphNEL, graphAM <-> bn (using functions in the bnlearn package)

ggm entries must be specified by cur_format = "ggm". PAG objects are those whose class inherits from gAlgo, or an adjacency matrix if cur_format = "PAG" is specified.


rje42/MixedGraphs documentation built on March 29, 2025, 11:47 p.m.