我正在尝试使用以下布局在R中构建流程图:
3列或垂直部分:
每个形状都应足够大,以使两行文本适合其上方,每行大约8个字符长。
下面是我要完成此操作的代码,但是出现以下错误:
# Prepare plot area
plot(0:100, 0:100, type = "n") #axes = F, xlab = NA, ylab = NA)
# Draw shapes
symbols(x = 50, y = 50, squares = 20, add = T) # square in middle
symbols(x = c(15, 15), y = c(70, 30), circles = c(5,5), add = T) # leftmost column of two circles
symbols(x = c(80, 80), y = c(70, 30), circles = c(5,5), add = T) # rightmost column of two circles
# Draw arrows
arrows(x0 = 25, y0 = 75, x1 = 43.5, y1 = 55) # upper-left arrow
arrows(x0 = 25, y0 = 25, x1 = 43.5, y1 = 45) # lower-left arrow
arrows(x0 = 57.5, y0 = 55, x1 = 75, y1 = 75) # upper-right arrow
arrows(x0 = 57.5, y0 = 45, x1 = 75, y1 = 25) # lower-right arrow