Lu Yang
2018-06-27 16:00:02 UTC
Hi, igraph team, ;-)
Thanks for creating the awesome tool.
I got the error when using the code below and the data enclosed. I do not
know why. Since it work for basic plot, but it got the error in the other
plot.
Hope to get help. Thanks in advance.
`library(igraph)
nodes000 <- read.xlsx("nodes.xlsx")
links000 <- read.xlsx("links.xlsx")
nrow(nodes000); length(unique(nodes000$genus))
nrow(links000); nrow(unique(links000[,c("from", "to")]))
links000 <- aggregate(links000[,3], links000[,-3], sum)
links000 <- links000[order(links000$from, links000$to),]
rownames(links000) <- NULL
net <- graph_from_data_frame(d=links000, vertices=nodes000, directed=F)
plot(net, edge.arrow.size=.4,vertex.label=NA) # It works
colrs <- c("grey", "tomato")
V(net)$color <- colrs[V(net)$type]
V(net)$size <- V(net)$logreads*2.5
V(net)$label.color <- "black"
V(net)$label <- NA
E(net)$width <- E(net)$x/6
E(net)$arrow.size <- .3
E(net)$edge.color <- "white"
E(net)$width <- 1+E(net)$x/12
plot(net, vertex.label.font=1,vertex.label.cex=.5) #got error(Error in
symbols(x = coords[, 1], y = coords[, 2], bg = vertex.color, : invalid
symbol parameter)
Best regards.
Thanks for creating the awesome tool.
I got the error when using the code below and the data enclosed. I do not
know why. Since it work for basic plot, but it got the error in the other
plot.
Hope to get help. Thanks in advance.
`library(igraph)
nodes000 <- read.xlsx("nodes.xlsx")
links000 <- read.xlsx("links.xlsx")
nrow(nodes000); length(unique(nodes000$genus))
nrow(links000); nrow(unique(links000[,c("from", "to")]))
links000 <- aggregate(links000[,3], links000[,-3], sum)
links000 <- links000[order(links000$from, links000$to),]
rownames(links000) <- NULL
net <- graph_from_data_frame(d=links000, vertices=nodes000, directed=F)
plot(net, edge.arrow.size=.4,vertex.label=NA) # It works
colrs <- c("grey", "tomato")
V(net)$color <- colrs[V(net)$type]
V(net)$size <- V(net)$logreads*2.5
V(net)$label.color <- "black"
V(net)$label <- NA
E(net)$width <- E(net)$x/6
E(net)$arrow.size <- .3
E(net)$edge.color <- "white"
E(net)$width <- 1+E(net)$x/12
plot(net, vertex.label.font=1,vertex.label.cex=.5) #got error(Error in
symbols(x = coords[, 1], y = coords[, 2], bg = vertex.color, : invalid
symbol parameter)
Best regards.