DEPRECATED: Simple interface to dynamicGraph
A simple interface to dynamicGraph in the
sense that the graph should not be given as an object
as to dynamicGraphMain. Here vertices can be
specified by a vector of text strings with names,
and/or edges by pairs of the indices of the vertices.
The function can also be used to add models and views to
an existing dynamicGraph.
The interface is deprecated: Use the method dg
on an object of class dg.simple.graph-class instead,
or the methods addModel, addView,
replaceModel, or replaceView.
DynamicGraph(names = character(), types = character(),
from = vector(), to = vector(), edge.list = list(NULL),
labels = names, edge.types = character(),
blocks = list(NULL), block.tree = list(NULL), oriented = NA,
factors = list(NULL), texts = character(),
extra.from = vector(), extra.to = vector(),
extra.edge.list = list(NULL),
object = NULL, viewType = "Simple",
frameModels = NULL, frameViews = NULL, graphWindow = NULL,
addModel = FALSE, addView = FALSE, overwrite = FALSE,
returnNewMaster = FALSE, redraw = FALSE,
control = dg.control(...), ...)names |
See |
types |
|
from |
|
to |
|
edge.types |
|
edge.list |
|
labels |
|
blocks |
|
block.tree |
|
oriented |
|
factors |
|
texts |
|
extra.from |
|
extra.to |
|
extra.edge.list |
|
viewType |
object |
The model |
frameModels |
An object of class |
frameViews |
An object of class |
graphWindow |
An object of class |
addModel |
Logical, if |
addView |
Logical, if |
overwrite |
Logical, see the argument |
redraw |
Logical. If TRUE then the dynamicGraph of the
arguments |
returnNewMaster |
Logical. Alternative implementation of
|
control |
Options for |
... |
Additional arguments to |
After converting the arguments for the graph
first to an object of class dg.simple.graph-class
then to an object of class dg.graph-class
the function dynamicGraphMain does all the work.
The list of objects can be exported from
dynamicGraphMain, also after modifying the graph.
The returned value from dynamicGraphMain.
Jens Henrik Badsberg
require(tcltk); require(dynamicGraph)
# Example 1:
W <- dg(as(new("dg.simple.graph", vertex.names = 1:5), "dg.graph"),
control = dg.control(title = "Very simple"))
# Example 2:
W <- dg(new("dg.simple.graph", from = 1:4, to = c(2:4, 1)),
control = dg.control(title = "Simply edges"))
# Example 3:
V.Types <- c("Discrete", "Ordinal", "Discrete",
"Continuous", "Discrete", "Continuous")
V.Names <- c("Sex", "Age", "Eye", "FEV", "Hair", "Shosize")
V.Labels <- paste(V.Names, 1:6, sep ="/")
From <- c(1, 2, 3, 4, 5, 6)
To <- c(2, 3, 4, 5, 6, 1)
W <- dg(new("dg.simple.graph", vertex.names = V.Names, types = V.Types,
labels = V.Labels, from = From, to = To),
control = dg.control(title = "With labels (extraVertices)"))
# Example 4: Oriented (cyclic) edges, without causal structure:
W <- dg(new("dg.simple.graph", vertex.names = V.Names, types = V.Types,
labels = V.Labels, from = From, to = To, oriented = TRUE),
control = dg.control(title = "Oriented edges"))
# Example 5: A factor graph:
Factors <- list(c(1, 2, 3, 4), c(3, 4, 5), c(4, 5, 6))
W <- dg(new("dg.simple.graph", vertex.names = V.Names, types = V.Types,
labels = V.Labels, factors = Factors, viewType = "Factor"),
control = dg.control(title = "Factorgraph", namesOnEdges = FALSE))
# Example 6: Edges with more than two vertices:
EdgeList <- list(c(1, 2, 3, 4), c(3, 4, 5), c(4, 5, 6))
W <- dg(new("dg.simple.graph", vertex.names = V.Names, types = V.Types,
labels = V.Labels, edge.list = EdgeList),
control = dg.control(title = "Multiple edges", namesOnEdges = FALSE))
WPlease choose more modern alternatives, such as Google Chrome or Mozilla Firefox.