spread | R Documentation |
Spreads a set of boxGrob
/boxPropGrob
in either horizontal or vertical direction.
spreadVertical(..., .from = NULL, .to = NULL, .type = c("between", "center"))
spreadHorizontal(..., .from = NULL, .to = NULL, .type = c("between", "center"))
... |
A set of boxes to spread. Can also be a |
.from |
A box that the spread originates from. If left empty the entire |
.to |
A box that the spread ends at. If left empty the entire |
.type |
If |
list
with the boxes that have been spread
Other flowchart components:
align
,
boxGrob()
,
boxPropGrob()
,
connectGrob()
,
coords()
,
distance()
,
moveBox()
library(grid)
grid.newpage()
box1 <- boxGrob("B1", x = .2, y = .8)
box2 <- boxGrob("B2\n\n\neach\nbox\neven\nspace\nbetween", x = .2, y = .8)
box3 <- boxGrob("B3", x = .2, y = .8)
box4 <- boxGrob("B4", x = .2, y = .8)
box5 <- boxGrob("B5", x = .2, y = .8)
spread_boxes <- spreadVertical(box1,
box2,
box3,
a = box4,
box5,
.type = "between")
for (b in spread_boxes) {
print(b)
}
box1 <- boxGrob("B1\n\nanother group\ncenter oriented", x = .6, y = .8)
box2 <- boxGrob("B2", x = .6, y = .8)
box3 <- boxGrob("B3", x = .6, y = .8)
box4 <- boxGrob("B4", x = .6, y = .8)
box5 <- boxGrob("B5", x = .6, y = .8)
spread_boxes <- spreadVertical(box1,
box2,
box3,
a = box4,
box5,
.type = "center")
for (b in spread_boxes) {
print(b)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.