【问题标题】:How do I find the rank of a node in rgraphviz?如何在 rgraphviz 中找到节点的等级?
【发布时间】:2015-05-03 06:13:06
【问题描述】:

我在 rgraphviz 中有一个有向无环图,它将被渲染为 DOT 图。我想根据节点的等级来控制节点的外观。如何找到节点的等级?

【问题讨论】:

    标签: r graphviz dot rank directed-acyclic-graphs


    【解决方案1】:

    这是我的答案。欢迎提出建议。

    gR 是形式类 GRAPHNEL 的对象

    gx <- layoutGraph(gR) #can also add node attributes, sublists here
    x <- gx@renderInfo@nodes$nodeX
    y <- gx@renderInfo@nodes$nodeY
    #x and y are named vectors with node names and x / y coordinates
    #to get the names of the nodes on the top rank:
    topNodes1 <- names(y[y==max(y)])
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-17
      • 2018-06-22
      • 2015-07-10
      • 2021-05-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多