blockTreeToList {dynamicGraph} | R Documentation |
Returns the list of blocks from a block tree.
blockTreeToList(tree)
tree |
The BlockTree part of the result of
setTreeBlocks . |
A list of blocks, each block of class dg.Block
.
Jens Henrik Badsberg
Block.tree <- list(label = "W", Vertices = c("contry"), 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) Labels(blockTreeToList(blocktree$BlockTree))