setBlocks(block.list, vertices, labels = NULL,
right.to.left = FALSE, nested.blocks = FALSE, blockColors = NULL, color = "Grey", N = 3)
blocks
.
Each item in the list is a vector with of the indices (or text
strings for names) of vertices of a block.vertices
, each
containing the class VertexProto
. Returned with positions
set in the interval of the blocks.labels
of the
blocks. If labels
is set to NULL
then labels are
found as names(block.list)
.right.to.left
is set to TRUE
then the explanatory blocks are drawn to the right.nested.blocks
then the
blocks are drawn nested.blockColors
of the blocks.color
of the blocks.
Only used when blockColors
is not given.N
is the number of coordinates of the
vertices and block corners.BlockProto
.require(tcltk)
require(dynamicGraph)
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)
# A block recursive model:
Blocks <- list(Basic = c(2, 1), Intermediate = c(5, 4, 3), Now = c(6))
V.Names <- paste(V.Names, c(1, 1, 2, 2, 2, 3), sep =":")
Z <- DynamicGraph(V.Names, V.Types, From, To, blocks = Blocks,
width = 600, height = 600, drawblocks = TRUE,
drawBlockBackground = FALSE, title = "DrawBlocks")
# A block recursiv model, without drawing blocks:
Z <- DynamicGraph(V.Names, V.Types, From, To, blocks = Blocks,
width = 600, height = 600,
drawblocks = FALSE, title = "No blocks drawn")
# A block recursive model with nested blocks:
Z <- DynamicGraph(V.Names, V.Types, From, To, blocks = Blocks,
width = 600, height = 600, drawblocks = TRUE,
nested.blocks = TRUE, title = "Nested blocks",
blockColors = paste("Grey", 100 - 2 * (1:10), sep = ""))
# The block list of the last example:
vertices <- returnVertexList(V.Names, types = V.Types)
blockList <- setBlocks(Blocks, vertices = vertices, nested.blocks = TRUE,
blockColors = paste("Grey", 100 - 2 * (1:10), sep = ""))
names(blockList)
str(blockList$Blocks[[1]])
names(blockList$Blocks)
Names(blockList$Blocks)
Labels(blockList$Blocks)
LabelPositions(blockList$Blocks)
Positions(blockList$Blocks)
Strata(blockList$Blocks)
Colors(blockList$Blocks)
NodeAncestors(blockList$Blocks)
NodeDescendants(blockList$Blocks)
Visible(blockList$Blocks)
Indices(blockList$Blocks)
names(blockList$Vertices)
Names(blockList$Vertices)
Labels(blockList$Vertices)
LabelPositions(blockList$Vertices)
Positions(blockList$Vertices)
Strata(blockList$Vertices)
Colors(blockList$Vertices)
Indices(blockList$Vertices)
Run the code above in your browser using DataLab