Learn R Programming

network (version 1.19.0)

network.edgelabel: Plots a label corresponding to an edge in a network plot.

Description

Draws a text labels on (or adjacent to) the line segments connecting vertices on a network plot.

Usage

network.edgelabel(
  px0,
  py0,
  px1,
  py1,
  label,
  directed,
  loops = FALSE,
  cex,
  curve = 0,
  ...
)

Value

no value is returned but text will be rendered on the active plot

Arguments

px0

vector of x coordinates of tail vertex of the edge

py0

vector of y coordinates of tail vertex of the edge

px1

vector of x coordinates of head vertex of the edge

py1

vector of y coordinate of head vertex of the edge

label

vector strings giving labels to be drawn for edge edge

directed

logical: is the underlying network directed? If FALSE, labels will be drawn in the middle of the line segment, otherwise in the first 3rd so that the labels for edges pointing in the opposite direction will not overlap.

loops

logical: if true, assuming the labels to be drawn belong to loop-type edges and render appropriately

cex

numeric vector giving the text expansion factor for each label

curve

numeric vector controling the extent of edge curvature (0 = straight line edges)

...

additional arguments to be passed to text

Author

skyebend

Details

Called internally by plot.network when edge.label parameter is used. For directed, non-curved edges, the labels are shifted towards the tail of the edge. Labels for curved edges are not shifted because opposite-direction edges curve the opposite way. Makes a crude attempt to shift labels to either side of line, and to draw the edge labels for self-loops near the vertex. No attempt is made to avoid overlap between vertex and edge labels.