data("PPI_Athalina")
### Example 1 #####
#####% 5 initial nodes are picked randomly #####
id <- level.plot(g1, init_nodes =5 ,tkplot=FALSE)
### Example 2 #####
#####% initial nodes are given as an input #####
id <- level.plot(g1, initial_nodes =c(1,4,5,7,9,11,25,27,29,100,101),
tkplot=FALSE)
### Example 3 #####
#####% width of each level is same #####
id <- level.plot(g1, initial_nodes
=c(1,4,5,7,9,11,25,27,29,100,101),
level.spread = TRUE,tkplot=FALSE)
### Example 4 #####
#####% plot of graph when nodes are not arranged based on the degree #####
id <- level.plot(g1, initial_nodes
=c(1,4,5,7,9,11,25,27,29,100,101),
order_degree= NULL, level.spread = TRUE,
tkplot=FALSE)
### Example 5 #####
#####% plot of graph when nodes are not arranged based on the degree #####
id <- level.plot(g1, initial_nodes
=c(1,4,5,7,9,11,25,27,29,100,101),
order_degree= NULL, level.spread = TRUE,
tkplot=FALSE)
### Example 6 #####
###% plot of graph using a forcebased algorithm
###in igraph package #####
xx <- level.plot(g1, layout.function=layout.reingold.tilford,
initial_nodes=c(1,4,5,7,9,11,25,27,29,100,101))
xx <- level.plot(g1, layout.function=layout.fruchterman.reingold,type=2,
init_nodes=20)
xx <- level.plot(g1, layout.function=layout.kamada.kawai,
type=1, init_nodes=20)
### Example 7 #####
## Shortest path between initial set of nodes at level '0'
## to a set of nodes with vertex id 10, 1000, 1001, 1002 ##%
id <- level.plot(g1, initial_nodes=c(101,1,5,7),
vertex.colors=c("white", "white", "white"),
edge.col=c("grey", "grey", "grey", "grey"),
nodeset= list(c(101,1,5,7),c(10,1000,1001,1002)),
tkplot=FALSE, level.spread=TRUE,
order_degree=NULL)
### Example 8 #####
### A directed network is plotted with level.plot function ##%
g <- barabasi.game(300, power=0)
id <- level.plot(g, tkplot=FALSE,
level.spread=TRUE, order_degree=NULL)
Run the code above in your browser using DataLab