3

以下からフロー図を再現しようとしています。

http://www.consort-statement.org/consort-statement/flow-diagram

以下はDiagrammeR私がこれまでに得た場所ですが、「除外された」ボックスを空白ノードと水平方向に揃えることができません。助言がありますか?

```{r, echo=FALSE, warning=FALSE, results='hide', message=FALSE}
 
library(pacman)
p_load(DiagrammeR)
 
grViz("digraph a_nice_graph { 
  node [fontname = Helvetica, shape = box, width = 4, fillcolor = LightSalmon, style = filled]
  assessed [label = 'Assessed for Elibibility (n = )']
  randomized [label = 'Randomized (n = )']
  allocatedA [label = 'Allocated to intervention A (n = )']
  allocatedB [label = 'Allocated to intervention B (n = )']
  lostA [label = 'Lost to follow-up (n = )']
  lostB [label = 'Lost to follow-up (n = )']
  analyzedA [label = 'Analyzed (n = )']
  analyzedB [label = 'Analyzed (n = )']
  blank[label = '', width = 0.01, height = 0.01]
  excluded[label = 'Excluded (n = )']

  subgraph cluster_0 {
    rankdir = TD
    color = white
    assessed -> blank [arrowhead = none]
    blank -> randomized
  }

  subgraph cluster_1 {
    rankdir = LR
    color = white
    blank -> excluded
  }
 
  randomized -> {allocatedA allocatedB}
  allocatedA -> lostA
  allocatedB -> lostB
  lostA -> analyzedA
  lostB -> analyzedB
}") 
```

これまでの結果のプロットは次のとおりです。

ここに画像の説明を入力

4

1 に答える 1

4

私は RMarkdown を使用していませんが、ブラウザーで確認しました。これは、セットアップでも「そのまま」機能するはずです。ポイントは、blankexcludedを同じランクに入れるだけです。あなたが試したサブグラフは必要ありません:

digraph a_nice_graph
{
    node [fontname = Helvetica, shape = box, width = 4, fillcolor = LightSalmon, style = filled]
    assessed [label = 'Assessed for Elibibility (n = )']
    randomized [label = 'Randomized (n = )']
    allocatedA [label = 'Allocated to intervention A (n = )']
    allocatedB [label = 'Allocated to intervention B (n = )']
    lostA [label = 'Lost to follow-up (n = )']
    lostB [label = 'Lost to follow-up (n = )']
    analyzedA [label = 'Analyzed (n = )']
    analyzedB [label = 'Analyzed (n = )']
    blank[label = '', width = 0.01, height = 0.01]
    excluded[label = 'Excluded (n = )']

    { rank = same; blank excluded }

    assessed -> blank[ dir = none ];
    blank -> excluded[ minlen = 3 ];
    blank -> randomized;
    randomized -> {allocatedA allocatedB};
    allocatedA -> lostA;
    allocatedB -> lostB;
    lostA -> analyzedA;
    lostB -> analyzedB;
}

収量

ここに画像の説明を入力

于 2017-10-21T07:33:30.373 に答える