for a dataframe
df <- data.frame(g1=c("x1","x2","x2","x3","x4","x5","x5","x3"),
g2=c("y1","y4","y2","y4","y3","y4","y5","y4"),
g1value=c(1,2,2,3,4,5,5,3),
g2value=c(2,4,2,4,5,4,NA, 4),
stringsAsFactors = FALSE)
library(igraph)
g=graph.data.frame(df, directed=F)
plot(g)
how shall i specify the size of nodes such that each size of x-nodes correspond to g1value,and y nodes to g2value (ignore the node if its size is na)?
and how to vary either node border colour or thickness on conditions, such as when the node is x2?
If there're many nodes, and the plotting result is crowded, anyway to space it out?
Thanks.