Learn R Programming

dynamicGraph (version 0.1.6.6)

newVertexEdge: The edge object

Description

Returns an object of the class EdgeProto for an edge between vertices.

Usage

newVertexEdge(vertex.indices, vertices = NULL, width = 2,
              color = "DarkOliveGreen", oriented = FALSE, type = NULL,
              label = ifelse(is.null(vertices), "",
                             paste(Labels(vertices), collapse = "~")))

Arguments

vertex.indices
Integer vector of the vertex.indices of the vertices of the edge. These are the indices of the vertices in the list of vertices.
vertices
All the vertices of the edge, and only the vertices of the edge. Currently, only used for setting the default label.
width
Numeric, for the width of the edge.
color
Text string for the color of the edge.
oriented
Logical, TRUE if the edge is oriented, also when no blocks are used in dynamicGraphMain.
type
Text string for the type of the edge. Currently not used. Intended to set which class the edge should be class of containing the class EdgeProto.
label
Text string for the label of the edge. By default set by concatenating the labels of the vertices.

Value

  • A object of class EdgeProto.

Details

Edges are not constrained to have two vertices.

Examples

Run this code
vertices <- returnVertexList(paste("V", 1:4, sep = ""))
e <- newVertexEdge(c(1, 2, 3), vertices = vertices[1:3])

str(e)

color(e)
label(e)
labelPosition(e)
width(e)
oriented(e)
nodeIndicesOfEdge(e)
nodeTypesOfEdge(e)

color(e) <- "Black"
label(e) <- "1-2"
labelPosition(e) <- c(10, 20, 30)
width(e) <- 1
oriented(e) <- TRUE
nodeIndicesOfEdge(e) <- c(1, 2)

str(e)

Run the code above in your browser using DataLab