我想用下面的DiagrammeR包构建一个基本流程图。下面的代码块正常工作。但是当我添加“。”或“ =”然后我得到
Error: syntax error in line 9 near '->'
library(DiagrammeR)
# A minimal plot
DiagrammeR::grViz("digraph {
graph[layout = dot, rankdir = LR]
BARI_POP4_5_PRIMARY_CN
12
ACR50
BARI_POP4_5_PRIMARY_CN -> 12 -> ACR50
}")
library(DiagrammeR)
# A minimal plot
DiagrammeR::grViz("digraph {
graph[layout = dot, rankdir = LR]
population=BARI_POP4_5_PRIMARY_CN.csv
12
ACR50
population=BARI_POP4_5_PRIMARY_CN.csv -> 12 -> ACR50
}")
结果应类似于: 但是在a,b和c位置分别具有人口= BARI_POP4_5_PRIMARY_CN.csv,12,ACR50。
答案 0 :(得分:1)
这对您有用吗?形状可以稍后修改
library(DiagrammeR)
grViz(
"digraph{
graph[layout='dot',outputorder=edgesfirst,overlap=T,rankdir=LR]
b[label='population=BARI_POP4_5_PRIMARY_CN.csv']
c [label='12']
d[label='ACR50']
b->c[label='link1']
c->d[label='link2']
}")
形状更改:看起来更好
grViz(
"digraph{
graph[layout='dot',outputorder=edgesfirst,overlap=T,rankdir=LR]
node[shape='box']
b[label='population=BARI_POP4_5_PRIMARY_CN.csv']
c [label='12']
d[label='ACR50']
b->c[label='link1']
c->d[label='link2']
}")