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(...), ...)
vertex.names
of
dg.simple.graph-class
. object
, or NULL,
see dg.Model-class
. DynamicGraph-class
.
frameModels
is the object for a dataset
and the models on that dataset. DynamicGraphModel-class
.
frameViews
is the object for a model
and the views of that model. DynamicGraphView-class
.
graphWindow
is the object for a view of a model. addModel
then a model is added
to the argument frameModels
, and a view of
the model is drawn.
If the argument overwrite
is TRUE and
the argument graphWindow
is given
then the model of graphWindow
is replaced
by the model argument object
.
If the argument overwrite
is TRUE and
the argument frameViews
is given
then the model of frame
\-Views is replaced
by the model argument object
.
addView
then a view of type set
by the argument viewType
for the model of the argument frameViews
is added. addModel
.
frameModels
is 'redrawn'.
New instances of the windows are made. addModel
, using the code of redraw
.
As redraw
, but the windows of
frameModels
exists,
and a new model is added. DynamicGraph
and
dynamicGraphMain
, see
dg.control
. dynamicGraphMain
. dynamicGraphMain
.
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.
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))
W
Run the code above in your browser using DataLab