【问题标题】:Create ids of an igraph graph using "internal" ids使用“内部”ids 创建 igraph 图的 ids
【发布时间】:2018-09-18 21:58:55
【问题描述】:

我在 R 中使用 igraph 包。我创建了一个随机的小世界图 sample_smallworld 函数。现在我想将这个新图的顶点的 id 设置为等于它们的“内部”id(即使用 print(V(graphname)) 获得的那些“id”)。我该怎么做?提前致谢。

【问题讨论】:

  • 我觉得你的问题有点不清楚。也许V(g)$name <- as_ids(V(g))
  • 谢谢,这正是我所需要的。

标签: r igraph social-networking


【解决方案1】:

您可以像这样将隐式名称转换为显式名称:

V(g)$name <- as_ids(V(g))

【讨论】:

    猜你喜欢
    • 2016-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-16
    • 2021-10-14
    • 1970-01-01
    • 2020-08-24
    • 2011-10-30
    相关资源
    最近更新 更多