Learn R Programming

ProNet (version 1.0.0)

visualization: Network visualization

Description

This function takes an igraph formatted network as input and exports a picture of the visulization. Mode of the layout, and size, color, shape of the nodes, edges and labels can be set according to the experiment data.

Usage

visualization(graph, layout = c("reingold.tilford", "circle", "random", "fruchterman.reingold", "sphere", "kamada.kawai", "lgl"), node.fill.color = "SkyBlue2", node.border.color = "Black", node.shape = c("circle", "square", "sphere", "csquare", "rectangle", "crectangle", "vrectangle", "none", "pie", "raster"), node.size = 15, node.label = "name", node.label.color = 1, node.label.size = 0.8, node.label.position = 0, edge.shape = 1, edge.width = 1, edge.color = "gray1", ...)

Arguments

graph
An igraph object.
layout
Mode of the layout, possible values are fruchterman.reingold, reingold.tilford, random, circle, kamada.kawai, lgl and sphere. See igraph for more information.
node.fill.color
The fill color of the vertex. Default value is SkyBlue2.
node.border.color
Border color the the vertex. Default value is Black.
node.shape
Shape of the vertex. currently circle, square, csquare, rectangle, crectangl, vrectangle and none are supported.
node.size
Size of the vertex. Default value is 15.
node.label
Label of the vertex. Specify NA to omit vertex labels. Default value is the vertex name.
node.label.color
Color of labels of the vertex. Default value is 1.
node.label.size
Font size of the vertex label. Default value is 0.8.
node.label.position
Positon of the vertex label. Default value is 0.
edge.shape
Shape of the edge. Default value is 1.
edge.width
Width of the edge. Default value is 1.
edge.color
Color of the edge. Default value is gray1.
...
Other arguments.

Value

A plot of the network.

Examples

Run this code
local<-data.frame(1:5,2:6)
attribute<-data.frame(node=1:6,value=c(2.2,5.3,1.2,4.5,6.2,0.6))
net<-construction(input=local,local.net=TRUE,node.attribute=attribute)
visualization(net,layout="reingold.tilford")
visualization(net,layout="reingold.tilford",node.size=V(net)$value)

Run the code above in your browser using DataLab