graphCr: Create graph from character parsing

View source: R/Graphs.R

graphCrR Documentation

Create graph from character parsing

Description

Convenience function for quickly constructing graphs with character input

Usage

graphCr(
  char,
  ...,
  mode = "adjList",
  useMatrices = FALSE,
  format = "mixedgraph"
)

edgeCr(char, mode = "eList", vnames)

Arguments

char

string of inputs given by vertex names separated by edges

...

other strings of further edges

mode

format for edges in graph

useMatrices

deprecated argument: in mixedgraph representation, should the output use adjacency matrices?

format

type of graph format to use, options are mixedgraph (the default), graphNEL (and graphAM, graphBAM), igraph, ggm, bn, PAG.

vnames

list of variable names for use in edgeCr

Details

Symbols ⁠-<>=*|:⁠ are assumed to be part of an edge, so cannot be used in node names using this function. Note that if we want an edge with an o on the end (e.g. ⁠o->⁠) then we must leave a space between the o and the variable name.

The edgeCr() creates just an edgeList object, and is helpful for adding edges to existing graphs. The vnames argument can be used if the graph has non-standard vertex labels.

Functions

  • edgeCr(): Create edge list by hand

Examples

graphCr("1--->2<-->3<-4","2<->4,4->5")
graphCr("1-2-3-4-1", representation="graphNEL")  # requires package 'graph'

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