EVOLUTION-MANAGER
Edit File: grid.pack.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Pack an Object within a Frame</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for grid.pack {grid}"><tr><td>grid.pack {grid}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Pack an Object within a Frame </h2> <h3>Description</h3> <p>these functions, together with <code>grid.frame</code> and <code>frameGrob</code> are part of a GUI-builder-like interface to constructing graphical images. The idea is that you create a frame with <code>grid.frame</code> or <code>frameGrob</code> then use these functions to pack objects into the frame. </p> <h3>Usage</h3> <pre> grid.pack(gPath, grob, redraw = TRUE, side = NULL, row = NULL, row.before = NULL, row.after = NULL, col = NULL, col.before = NULL, col.after = NULL, width = NULL, height = NULL, force.width = FALSE, force.height = FALSE, border = NULL, dynamic = FALSE) packGrob(frame, grob, side = NULL, row = NULL, row.before = NULL, row.after = NULL, col = NULL, col.before = NULL, col.after = NULL, width = NULL, height = NULL, force.width = FALSE, force.height = FALSE, border = NULL, dynamic = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>gPath</code></td> <td> <p> A gPath object, which specifies a frame on the display list.</p> </td></tr> <tr valign="top"><td><code>frame</code></td> <td> <p> An object of class <code>frame</code>, typically the output from a call to <code>grid.frame</code>. </p> </td></tr> <tr valign="top"><td><code>grob</code></td> <td> <p> An object of class <code>grob</code>. The object to be packed. </p> </td></tr> <tr valign="top"><td><code>redraw</code></td> <td> <p> A boolean indicating whether the output should be updated. </p> </td></tr> <tr valign="top"><td><code>side</code></td> <td> <p> One of <code>"left"</code>, <code>"top"</code>, <code>"right"</code>, <code>"bottom"</code> to indicate which side to pack the object on. </p> </td></tr> <tr valign="top"><td><code>row</code></td> <td> <p> Which row to add the object to. Must be between 1 and the-number-of-rows-currently-in-the-frame + 1, or <code>NULL</code> in which case the object occupies all rows. </p> </td></tr> <tr valign="top"><td><code>row.before</code></td> <td> <p> Add the object to a new row just before this row. </p> </td></tr> <tr valign="top"><td><code>row.after</code></td> <td> <p> Add the object to a new row just after this row. </p> </td></tr> <tr valign="top"><td><code>col</code></td> <td> <p> Which col to add the object to. Must be between 1 and the-number-of-cols-currently-in-the-frame + 1, or <code>NULL</code> in which case the object occupies all cols. </p> </td></tr> <tr valign="top"><td><code>col.before</code></td> <td> <p>Add the object to a new col just before this col.</p> </td></tr> <tr valign="top"><td><code>col.after</code></td> <td> <p> Add the object to a new col just after this col. </p> </td></tr> <tr valign="top"><td><code>width</code></td> <td> <p> Specifies the width of the column that the object is added to (rather than allowing the width to be taken from the object). </p> </td></tr> <tr valign="top"><td><code>height</code></td> <td> <p> Specifies the height of the row that the object is added to (rather than allowing the height to be taken from the object). </p> </td></tr> <tr valign="top"><td><code>force.width</code></td> <td> <p> A logical value indicating whether the width of the column that the grob is being packed into should be EITHER the width specified in the call to <code>grid.pack</code> OR the maximum of that width and the pre-existing width. </p> </td></tr> <tr valign="top"><td><code>force.height</code></td> <td> <p> A logical value indicating whether the height of the column that the grob is being packed into should be EITHER the height specified in the call to <code>grid.pack</code> OR the maximum of that height and the pre-existing height. </p> </td></tr> <tr valign="top"><td><code>border</code></td> <td> <p> A <code>unit</code> object of length 4 indicating the borders around the object. </p> </td></tr> <tr valign="top"><td><code>dynamic</code></td> <td> <p> If the width/height is taken from the grob being packed, this boolean flag indicates whether the grobwidth/height unit refers directly to the grob, or uses a gPath to the grob. In the latter case, changes to the grob will trigger a recalculation of the width/height.</p> </td></tr> </table> <h3>Details</h3> <p><code>packGrob</code> modifies the given frame grob and returns the modified frame grob. </p> <p><code>grid.pack</code> destructively modifies a frame grob on the display list (and redraws the display list if <code>redraw</code> is <code>TRUE</code>). </p> <p>These are (meant to be) very flexible functions. There are many different ways to specify where the new object is to be added relative to the objects already in the frame. The function checks that the specification is not self-contradictory. </p> <p>NOTE that the width/height of the row/col that the object is added to is taken from the object itself unless the <code>width</code>/<code>height</code> is specified. </p> <h3>Value</h3> <p><code>packGrob</code> returns a frame grob, but <code>grid.pack</code> returns <code>NULL</code>. </p> <h3>Author(s)</h3> <p> Paul Murrell </p> <h3>See Also</h3> <p><code><a href="grid.frame.html">grid.frame</a></code>, <code><a href="grid.place.html">grid.place</a></code>, <code><a href="grid.edit.html">grid.edit</a></code>, and <code><a href="gPath.html">gPath</a></code>. </p> <hr /><div style="text-align: center;">[Package <em>grid</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>