View source: R/boxGrobs_prConvert2Coords.R
| prConvert2Coords | R Documentation |
Sometimes we have an object that can be either a box,
a coordinate, a unit or a numerical value and all we
want is a list of coordinates that we can use for
calculating distance, alignment and other things.
prConvert2Coords(obj)
obj |
A single or a
When a |
When given a list, prConvert2Coords computes the min/max of
edges (or uses center +/- half sizes when edges are missing) to create a
merged bounding box. Any additional coordinate names present on elements
are merged heuristically (for example, left* -> min, right* -> max,
otherwise averaged).
A list with the points produced by coords. For list inputs the
function returns merged bounding coordinates (class box_coords) with
units in npc.
box1 <- boxGrob("A", x = .2, y = .8)
box2 <- boxGrob("B", x = .6, y = .4)
Gmisc:::prConvert2Coords(list(box1, box2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.