parse.graphml {causaleffect} | R Documentation |
Prepare GraphML files for internal use
Description
This function reads GraphML files created by a graphical editor, which describe directed acyclic graphs. The R package XML is utilized to parse the contents of the files to suit the internal format used by causal inference functions. Bidirected arcs are replaced by two unobserved directed arcs, and the resulting XML file is coerced into an igraph object. This function also serves as a wrapper for files that already correspond to the internal format. Names for the nodes of the graph can be supplied or read directly from the input file.
Usage
parse.graphml(file, format = c("standard", "internal"),
nodes = c(), use.names = TRUE)
Arguments
file |
The connection to read from. |
format |
A character constant describing how bidirected arcs are denoted in the GraphML file.
Option |
nodes |
A character vector that describes the names of the nodes in the graph. This is ignored if |
use.names |
A logical value indicating whether the names of the nodes should be read from the file or not. |
Value
An object of class igraph that describes the causal diagram. The parsed graph can now be used by other functions of the package.
Author(s)
Santtu Tikka