Description Usage Arguments Value Slots Extends Methods Note Author(s) Examples
Return a list of block edges, each of class dg.BlockEdge.
Objects can be created by calls of the form new("dg.BlockEdgeList", ...).
1 2 3 |
edge.list |
A list of vectors identifying the edges (between vertices).
Each vector of |
vertices |
The list of |
blocks |
The list of |
visibleBlocks |
A numeric vector with the indices of the
|
width |
A numeric with the initial |
color |
"default", or list with one or two text strings for colors
giving the initial |
N |
Integer, |
oriented |
Logical, if TRUE then the edges are |
type |
A text string giving the |
A list of block edges, each of class dg.BlockEdge.
.Data:Object of class "list".
Class "dg.EdgeList", directly.
Class "dg.list", directly.
Class "list", from data part.
Class "dg.NodeList", by class "dg.EdgeList".
Class "vector", by class "dg.EdgeList".
Class "vector", by class "dg.list".
Class "vector", by class "list".
signature(.Object = "dg.BlockEdgeList"): ...
signature(blockList = "dg.BlockList"): ...
signature(blockList = "dg.BlockList"): ...
signature(blockList = "dg.BlockList"): ...
The methods of the edge list, returnEdgeList,
also applies for block edge lists.
Jens Henrik Badsberg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | Block.tree <- list(label = "W", Vertices = c("country"),
X = list(Vertices = c("sex", "race"),
A = list(Vertices = c("hair", "eye"),
horizontal = FALSE),
B = list(Vertices = c("age"),
C = list(Vertices = c("education")))))
Names <- unlist(Block.tree)
Names <- Names[grep("Vertices", names(Names))]
Types <- rep("Discrete", length(Names))
vertices <- returnVertexList(Names, types = Types)
blocktree <- setTreeBlocks(Block.tree, vertices)
blocks <- blockTreeToList(blocktree$BlockTree)
from <- c("country", "country", "race", "race", "sex", "sex")
to <- c( "sex", "race", "hair", "eye", "education", "age")
from <- match(from, Names)
to <- match(to, Names)
edge.list <- vector("list", length(to))
for (j in seq(along = to)) edge.list[[j]] <- c(from[j], to[j])
edges <- returnEdgeList(edge.list, vertices, color = "red", oriented = TRUE)
vertices <- blocktree$Vertices
blockedges <- returnBlockEdgeList(edge.list, vertices, blocks,
color = "red", oriented = TRUE)
blockedges <- new("dg.BlockEdgeList", edge.list = edge.list,
vertices = vertices, blocks = blocks,
color = "red", oriented = TRUE)
Names(blockedges)
Colors(blockedges)
Labels(blockedges)
LabelPositions(blockedges)
# Positions(blockedges)
# Strata(blockedges)
# Indices(blockedges)
str(NodeTypes(blockedges))
str(NodeIndices(blockedges))
Widths(blockedges)
Oriented(blockedges)
Widths(blockedges) <- rep(1, 7)
Widths(blockedges) <- rep(1, 14)
Widths(blockedges)
asDataFrame(blockedges)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.