Retrieves the distance between two boxes as absolute "mm" units. The function also
accepts coords objects as well as a unit or a numeric input.
Usage
distance(
box1,
box2,
type = c("vertical", "horizontal", "euclidean"),
half = FALSE,
center = FALSE
)
# S3 method for Gmisc_unit
print(x, ...)
Value
A unit in "mm" with an absolute value. The attribute
positive indicates the direction of the value, i.e. if it is TRUE the
distance was calculated from the first to the second, otherwise it is FALSE.
For euclidean distance the positive attribute is NA. There is also the
from and to attributes that has the coordinates that were used for the
calculations, for euclidean distance this is NA.
Arguments
box1
The first boxGrob. Can also be a coords
object, a unit or a numeric. The latter is evaluated to
a unit with units="npc".
box2
The second object to calculate the distance to. Same type as for box1.
type
Whether we should retrieve the vertical, horizontal or euclidean distance
half
If set to true it returns half the distance. This is convenient
when positioning boxes between each other.
center
Calculate the distance from the center of each object
x
A unit with from the distance function
...
Passed on to print
See Also
Other flowchart components:
align,
boxGrob(),
boxPropGrob(),
connectGrob(),
coords(),
moveBox(),
spread