require(tcltk)
require(dynamicGraph)
# Example 1:
Z <- DynamicGraph(paste("", 1:5), title = "Very simple")
# Example 2:
Z <- DynamicGraph(from = 1:4, to = c(2:4, 1), title = "Simply edges")
# Example 3:
V.Types <- c("Discrete", "Ordinal", "Discrete",
"Continuous", "Discrete", "Continuous")
V.Names <- c("Sex", "Age", "Eye", "FEV", "Hair", "Shosize")
V.Names <- paste(V.Names, 1:6, sep ="/")
From <- c(1, 2, 3, 4, 5, 6)
To <- c(2, 3, 4, 5, 6, 1)
Z <- DynamicGraph(V.Names, V.Types, From, To, texts = c("Gryf", "Gaf"),
title = "With labels")
# Example 4: Oriented (cyclic) edges, without causal structure:
Z <- DynamicGraph(V.Names, V.Types, From, To, oriented = TRUE,
title = "Oriented edges")
# Example 5: A factor graph:
Factors <- list(c(1, 2, 3, 4), c(3, 4, 5), c(4, 5, 6))
Z <- DynamicGraph(V.Names, V.Types, from = NULL, to = NULL, factors = Factors,
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))
Z <- DynamicGraph(V.Names, V.Types, edge.list = EdgeList,
title = "Multiple edges", namesOnEdges = FALSE)
Run the code above in your browser using DataLab