Learn R Programming

dynamicGraph (version 0.1.6.6)

newBlock: The block object

Description

Returns an object of class BlockProto.

Usage

newBlock(stratum = 0, index = 0, position = matrix(rep(0, 6), ncol = 3),
         closed = FALSE, visible = TRUE, color = "Grey", label = "Label",
         label.position = c(0, 0, 0), ancestors = NULL)

Arguments

stratum
Integer for the stratum of the block.
index
Integer for the index of the block.
position
Numeric vector for the position of the block, the two diagonal opposite corners.
closed
Logical, if TRUE then the block is drawn as a "vertex".
visible
Logical, if TRUE then the block is drawn.
color
Text string for the color of the block.
label
Text string for the label of the block.
label.position
Numeric vector for the label.position of the block label.
ancestors
Integer vector for the ancestor blocks of the block. The slot with the descendant blocks is set after the creation of the block.

Value

  • A object of class BlockProto.

See Also

newVertex

Examples

Run this code
b <- newBlock()
str(b)

color(b)
label(b)
labelPosition(b)
name(b)
index(b)
position(b)
stratum(b)
ancestors(b)
descendants(b)
visible(b)

color(b) <- "grey"
label(b) <- "NameAndLabel"
labelPosition(b) <- c(1, 2, 3)
# name(b) <- "NameAndLabel" # Not possible!!!
index(b) <- 3
position(b) <- matrix(c( 10,  20,  30,  40, 
                        110, 120, 130, 140), byrow = TRUE, ncol = 4)
stratum(b) <- 1
ancestors(b) <- c(1, 2)
descendants(b) <- c(4, 5)
visible(b) <- FALSE

str(b)

Run the code above in your browser using DataLab