如何在igraph上显示特定标签?

时间:2018-06-13 11:34:41

标签: r igraph

我有一个非常大的igraph但是当我绘制时,我希望只显示特定的标签。这些标签保存在不同的dfs(activatorreceptor)中。 我尝试过:

nodes <- data.frame(symbol = LETTERS[1:7])
edges <- data.frame(from=c("B", "C", "D", "D", "D", "E", "A", "G"),
                    to = c("A", "B", "A", "E", "B", "A", "F", "F"))

activator <- c('A')
receptor <- c('E', 'F', 'G')

g <- graph_from_data_frame(edges, directed=TRUE, vertices=nodes)
print(g, e=TRUE, v=TRUE)
plot(g, vertex.label1 = ifelse(V(g)$name %in% c(activator, receptor), V(g)$name, NA))  

但它不起作用。有什么意见吗?

0 个答案:

没有答案