Learn R Programming

dynamicGraph (version 0.1.6.6)

newVertex: The vertex object

Description

Returns an object of a class containing VertexProto.

Usage

newVertex(name, label = name, type = "VertexProto", index = 1,
          position = c(0, 0, 0), blockindex = 0, stratum = 0,
          color = ifelse(type == "TextVertex", "GhostWhite", "SaddleBrown"),
          vertexClasses = validVertexClasses())

Arguments

name
Text string with the name of the vertex. Should be a valid name on variables for your model object.
label
Text string with the label of the vertex.
type
Text string with the type of the vertex. This type is the label of class of the vertex, the labels of vertexClasses.
index
Integer with the index of the vertex, the position in a vertex list.
position
Numeric vector with the position of the vertex. Vertices in the same dynamic graph should have the same number of coordinates.
blockindex
Integer with the blockindex of the vertex.
stratum
Integer with the stratum of the vertex.
color
Text string with the color of the vertex.
vertexClasses
The valid vertexClasses.

Value

  • A object of a class containing the class VertexProto.

Examples

Run this code
a <- newVertex("a", "A", "Discrete", 1, c(0, 0, 0))

str(a)

color(a)
label(a)
labelPosition(a)
name(a)
index(a)
position(a)
stratum(a)

color(a) <- "red"
label(a) <- "A vertex"
labelPosition(a) <- c(1, 2, 3)
name(a) <- "Capital.A"
index(a) <- -1
position(a) <- c(10, 20, 30)
stratum(a) <- 1

str(a)

Run the code above in your browser using DataLab