Learn R Programming

loop (version 1.1)

gplot: make a plot for directional graph from edge matrix graph form

Description

can change the link line style and color, can add arrows at the ending points, this function requires an edge matrix form of graphs, compared to another similar function 'gplot1'.

Usage

gplot(edgemat,arrow=TRUE,lty=1,col=8,weighted=TRUE)

Arguments

edgemat
graph edge matrix form, without confusion, 'loop' package will have two types for the graph storage: square matrix from (argument is 'gemat') and edge matrix form (argument is 'edgemat').
arrow
default is TRUE, denoting arrows should be added in the plot
lty
line style for each graph link
col
line color for each graph link
weighted
if TRUE, the links/edges will be weighted based on the value present in the 3rd column of edgemat, different edges then will have different line widths for representing them. Otherwise, all edges have the same line width. Default is TRUE

References

Chen Y (2012) loop: an R package for performing decomposition of weighted directed graphs, food web analysis and flexible network plotting. Submitted.

See Also

decomp, loop.forward, loop.random, gplot1, fplot, groupplot

Examples

Run this code
#make plots
mat<-matrix(c(1,2,1,3,2,4,3,5,4,5,6,7,8,9,1,9,9,8),nrow=9,ncol=2)
w<-c(3,10,30,50,20,22,9,15,33)
mat<-cbind(mat,w)
gplot(edgemat=mat)

Run the code above in your browser using DataLab