Learn R Programming

dynamicGraph (version 0.1.6.6)

returnEdgeList: The edge list

Description

Return a list of edges, each of class containing VertexEdgeProto.

Usage

returnEdgeList(edge.list, vertices, width = 2, color = "DarkSlateGrey",
               oriented = FALSE, type = NULL)

Arguments

edge.list
A list of vectors identifying the edges. Each vector of edge.list should be a vector of integers giving the indices of the vertices of an edge, or a vector of text strings with the
vertices
The list of vertices, each of a class containing VertexProto. vertices are used to set the initial labels of the edges.
width
A single numeric with the initial width of the edges.
color
A single text string giving the color of the edges.
oriented
Logical, if TRUE then the edges are oriented.
type
A single text string giving the type of the edges. The label type of an edge class is currently not used, but intended to identify which class the edges should be of containing the VertexEdgeProto.

Value

  • A list of edges, each of class containing VertexEdgeProto.

See Also

vertexList and newVertexEdge.

Examples

Run this code
from <- c("contry", "contry", "race", "race",       "sex",  "sex")
to   <- c(   "sex",   "race", "hair",  "eye", "education",  "age")
vertexnames <- unique(sort(c(from, to)))
vertices <- returnVertexList(vertexnames)
# from <- match(from, vertexnames)
# to <- match(to, vertexnames)
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)

Names(edges)
Colors(edges)
Labels(edges)
LabelPositions(edges)
# Positions(edges)
# Strata(edges)
# Indices(edges)
str(NodeTypes(edges))
str(NodeIndices(edges))
Widths(edges)
Oriented(edges)
Widths(edges) <- rep(1, 7)
Widths(edges) <- rep(1, 6)
Widths(edges)

Run the code above in your browser using DataLab