Learn R Programming

Gmisc (version 1.8.1)

distance: Get the distance between boxes

Description

Retrieves the distance between two boxes as absolute "mm" units.

Usage

distance(box1, box2, type = c("vertical", "horizontal"), half = FALSE)

Arguments

box1

The first boxGrob

box2

The second boxGrob

type

Wheter we should retrieve the vertical or horizontal difference

half

If set to true it returns half the distance. This is convenient when postioning boxes between eachother.

Value

a unit with "mm"

Examples

Run this code
# NOT RUN {
box1 <- boxGrob("A test box", y=.8)
box2 <- boxGrob("Another test box", y=.2)
distance(box1, box2, "v")
# }

Run the code above in your browser using DataLab