Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将 id 属性作为标签添加到我的顶点,并将它们显示在图中。我用下面的代码做的:
V(novel)$label <- V(novel)$id plot(novel)
但是,我只想显示加权度数超过 30 的顶点的 id。我尝试了下面的代码,但它只给了我TRUE或FALSE作为输出,而不是过滤顶点。
TRUE
FALSE
graph.strength(novel) > 30
如何过滤绘图应在哪些顶点显示 id?
V(novel)$label <- ifelse(graph.strength(novel) > 30, V(novel)$id, "")应该做的伎俩;基本上,您为那些强度小于或等于 30 的顶点设置了一个空标签。
V(novel)$label <- ifelse(graph.strength(novel) > 30, V(novel)$id, "")