Learn R Programming

RNewsflow (version 1.0.1)

directed.network.plot: A wrapper for plot.igraph for visualizing directed networks.

Description

This is a convenience function for visualizing directed networks with edge labels using plot.igraph. It was designed specifically for visualizing aggregated document similarity networks in the RNewsflow package, but works with any network in the igraph class.

Usage

directed.network.plot(g, weight.var = "from.Vprop", weight.thres = NULL, delete.isolates = FALSE, vertex.size = 30, vertex.color = "lightblue", vertex.label.color = "black", vertex.label.cex = 0.7, edge.color = "grey", show.edge.labels = TRUE, edge.label.color = "black", edge.label.cex = 0.6, edge.arrow.size = 1, layout = igraph::layout.davidson.harel, ...)

Arguments

g
A network/graph in the igraph class
weight.var
The edge attribute that is used to specify the edges
weight.thres
A threshold for weight. Edges below the threshold are ignored
delete.isolates
If TRUE, isolates (i.e. vertices without edges) are ignored.
vertex.size
The size of the verticex/nodes. Defaults to 30. Can be a vector with values per vertex.
vertex.color
Color of vertices/nodes. Default is lightblue. Can be a vector with values per vertex.
vertex.label.color
Color of labels for vertices/nodes. Defaults to black. Can be a vector with values per vertex.
vertex.label.cex
Size of the labels for vertices/nodes. Defaults to 0.7. Can be a vector with values per vertex.
edge.color
Color of the edges. Defaults to grey. Can be a vector with values per edge.
show.edge.labels
Logical. Should edge labels be displayed? Default is TRUE.
edge.label.color
Color of the edge labels. Defaults to black. Can be a vector with values per edge.
edge.label.cex
Size of the edge labels. Defaults to 0.6. Can be a vector with values per edge.
edge.arrow.size
Size of the edge arrows. Defaults to 1. Can only be set globally (igraph might update this at some point)
layout
The igraph layout used to plot the network. Defaults to layout.davidson.harel
...
Arguments to be passed to the plot.igraph function.

Value

Nothing

Examples

Run this code
data(docnet)
aggdocnet = network.aggregate(docnet, by='source')
directed.network.plot(aggdocnet, weight.var = 'to.Vprop', weight.thres = 0.2)

Run the code above in your browser using DataLab