我正在尝试使用 R 和 DiagrammeR 制作 SEM 图。我已经设置了图表,但我试图在图表底部添加一些节点(CSEW、ONS 和 Police),以便于阅读。
这是我到目前为止所拥有的。任何关于如何将三个圆圈移到底部的建议都将受到欢迎。
library(DiagrammeR)
grViz("
digraph MTMM {
subgraph {
node [shape = box, fixedsize = true, width = 1]
rank = same; bike_c; bike_p; bike_o
burg_c; burg_p; burg_o
theft_c; theft_p; theft_o
viol_c; viol_p; viol_o
}
subgraph {
node [shape = circle, fixedsize = true, width = 1]
Bicycle; Burglary; Theft; Violence
}
subgraph {
node [shape = circle, fixedsize = true, width = 1]
CSEW; ONS; Police
}
Bicycle -> {bike_c bike_p bike_o}
Burglary -> {burg_c burg_p burg_o}
Theft -> {theft_c theft_p theft_o}
Violence -> {viol_c viol_p viol_o}
CSEW -> {bike_c burg_c theft_c viol_c} [label = '1']
ONS -> {bike_o burg_o theft_o viol_o} [label = '1']
Police -> {bike_p burg_p theft_p viol_p} [label = '1']
{rank = same; CSEW; ONS; Police}
{rank = same; Bicycle; Burglary; Theft; Violence}
}
")