R代码,使用DiagrammeR以编程方式生成一个排序图



我想以编程方式创建一个描述随机试验中患者流程的配对图。

是否有人有R代码生成这个图(见下面的链接)使用DiagrammeR?

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

5年前在stackoverflow上的提问。答案使用包:使用R

创建显示案例数的树形图

Google找到了一些graphviz代码:http://blogs.sas.com/content/graphicallyspeaking/2016/10/20/outside-box-consort-diagram/

RStudio可以直接预览Graphviz .dot文件:

https://blog.rstudio.org/2015/05/01/rstudio - v0 - 99预览- graphviz -和- diagrammer/

或者

library(DiagrammeR)
consort <- file("consort.dot")
grViz(diagram = consort)
close(consort)

"配偶。点":

digraph g {
start [shape = box, label = "CONSORT Graph"];
node0 [shape = box, label = "All PatientsnN=1000"];
node1 [shape = box, label = "Full Analysis SetnN=800"];
node2 [shape = box, label = "ExcludednN=100"];
node3 [shape = box, label = "Not IncludednN=100"];
node4 [shape = box, label = "Safety SetnN=700"];
node5 [shape = box, label = "Not DosednN=100"];
node6 [shape = box, label = "Treatment AnN=200"];
node7 [shape = box, label = "Treatment BnN=150"];
node8 [shape = box, label = "Treatment CnN=200"];
node9 [shape = box, label = "Treatment DnN=150"];
start -> node0 -> node1 -> node4 -> {node6 node7 node8 node9};
node0 -> node2;
node0 -> node3;
node1 -> node5;
}

相关内容

  • 没有找到相关文章

最新更新