Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 总流向图_R_Diagram_Diagrammer - Fatal编程技术网

R 总流向图

R 总流向图,r,diagram,diagrammer,R,Diagram,Diagrammer,我想制作一个带有DiagramR的图表 这是我的密码 require(DiagrammeR) grViz(" digraph boxes_and_circles { node [shape = box, fontname = Helvetica] A; B; C; D B->A C->A D->B } ") 但我得到了这个结果 我需要像这个一样的 如何将流向设置为向上?您可

我想制作一个带有DiagramR的图表

这是我的密码

    require(DiagrammeR)
    grViz("
    digraph boxes_and_circles {
    node [shape = box,
        fontname = Helvetica]
    A; B; C; D
    B->A C->A D->B
    }
    ")
但我得到了这个结果

我需要像这个一样的


如何将流向设置为向上?

您可以设置参数
rankdir
,并将颜色添加到
边缘和
节点

library(DiagrammeR)
grViz("
    digraph boxes_and_circles {
    
        rankdir = BT
    
       node [shape = box,
             fontname = Helvetica,
             color = gray
            ]
            A; B; C; D

       edge [color = gray]
            B->A C->A D->B
      }
    ")

谢谢你@s_u;!!这就是解决办法!