1 2 3 4 5 6 7 8 | get.ggplot_ggnet.custom(net, mode = "fruchtermanreingold",
layout.par = NULL, size = 12, alpha = 0.75, weight.method = "none",
names = c("", ""), node.group = NULL, node.color = NULL,
node.alpha = NULL, segment.alpha = NULL, segment.color = "grey",
segment.label = NULL, segment.size = 0.25, arrow.size = 0,
label.nodes = FALSE, label.size = size/2, top8.nodes = FALSE,
trim.labels = TRUE, quantize.weights = FALSE, subset.threshold = 0,
legend.position = "right", organise.sl = TRUE, ...)
|
net |
an object of class |
mode |
a placement method from the list of modes provided in the sna package. Defaults to the Fruchterman-Reingold force-directed algorithm. If |
layout.par |
options to the placement method, as listed in gplot.layout. |
size |
size of the network nodes. Defaults to 12. If the nodes are weighted, their area is
proportionally scaled up to the size set by |
alpha |
a level of transparency for nodes, vertices and arrows. Defaults to 0.75. |
weight.method |
a weighting method for the nodes. Accepts |
names |
a character vector of two elements to use as legend titles for the node groups and node weights. Defaults to empty strings. |
node.group |
a vector of character strings to label the nodes, of the same length and order as the vertex names. Factors are converted to strings prior to plotting. |
node.color |
a vector of character strings to color the nodes, holding as many colors as there are levels in |
node.alpha |
transparency of the nodes. Inherits from |
segment.alpha |
transparency of the vertex links. Inherits from |
segment.color |
color of the vertex links. Defaults to |
segment.label |
labels for the vertex links at mid-edges. Label size will be set to 1 / |
segment.size |
size of the vertex links, as a vector of values or as a single value. Defaults to 0.25. |
arrow.size |
size of the vertex arrows for directed network plotting, in centimeters. Defaults to 0. |
label.nodes |
label nodes with their vertex names attribute. If |
top8.nodes |
use the top 8 nodes as node groups, colored with |
trim.labels |
removes '@', 'http://', 'www.' and the ending '/' from vertex names. Cleans up labels for website and Twitter networks. Defaults to |
quantize.weights |
breaks node weights to quartiles. Fails when quartiles do not uniquely identify nodes. |
subset.threshold |
deletes nodes prior to plotting, based on |
legend.position |
location of the captions for node colors and weights. Accepts all positions supported by ggplot2 themes. Defaults to "right". |
... |
other arguments supplied to geom_text for the node labels. Arguments pertaining to the title or other items can be achieved through ggplot2 methods. |
geo.outliers |
when |
Plot a network with ggplot2 based on GGally::ggnet ggnet.custom is based on GGally::gget and returns two objects: the network and the matrix with the coordinates of each edge of the network. This funtion, used in get.plot, is based on ggnet function from Gapply package coded by Moritz Marbach and Francois Briatte for details see https://github.com/briatte/ggnet/blob/master/ggnet.R
The weight.method
argument produces visually scaled nodes that are proportionally sized to their unweighted degree. To compute weighted centrality or degree measures, see Tore Opsahl's tnet
package.
Moritz Marbach and Francois Briatte for the core function. Pierre Rivière for the little changes in the output.
get.plot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.