EVOLUTION-MANAGER
Edit File: tbl_format_setup.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: Set up formatting</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 tbl_format_setup {pillar}"><tr><td>tbl_format_setup {pillar}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Set up formatting</h2> <h3>Description</h3> <p><code>tbl_format_setup()</code> is called by <code><a href="format_tbl.html">format.tbl()</a></code>. This method collects information that is common to the header, body, and footer parts of a tibble. Examples: </p> <ul> <li><p> the dimensions sometimes are reported both in the header and (implicitly) in the footer of a tibble; </p> </li> <li><p> the columns shown in the body decide which columns are shown in the footer. </p> </li></ul> <p>This information is computed once in <code>tbl_format_setup()</code>. The result is passed on to the <code><a href="tbl_format_header.html">tbl_format_header()</a></code>, <code><a href="tbl_format_body.html">tbl_format_body()</a></code>, and <code><a href="tbl_format_footer.html">tbl_format_footer()</a></code> methods. If you need to customize parts of the printed output independently, override these methods instead. </p> <h3>Usage</h3> <pre> tbl_format_setup( x, width = NULL, ..., n = NULL, max_extra_cols = NULL, max_footer_lines = NULL, focus = NULL ) ## S3 method for class 'tbl' tbl_format_setup(x, width, ..., n, max_extra_cols, max_footer_lines, focus) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>An object.</p> </td></tr> <tr valign="top"><td><code>width</code></td> <td> <p>Actual width for printing, a numeric greater than zero. This argument is mandatory for all implementations of this method.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Extra arguments to <code><a href="format_tbl.html">print.tbl()</a></code> or <code><a href="format_tbl.html">format.tbl()</a></code>.</p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>Actual number of rows to print. No <a href="pillar_options.html">options</a> should be considered by implementations of this method.</p> </td></tr> <tr valign="top"><td><code>max_extra_cols</code></td> <td> <p>Number of columns to print abbreviated information for, if the width is too small for the entire tibble. No <a href="pillar_options.html">options</a> should be considered by implementations of this method.</p> </td></tr> <tr valign="top"><td><code>max_footer_lines</code></td> <td> <p>Maximum number of lines for the footer. No <a href="pillar_options.html">options</a> should be considered by implementations of this method.</p> </td></tr> <tr valign="top"><td><code>focus</code></td> <td> <p><a href="https://lifecycle.r-lib.org/articles/stages.html#experimental"><img src="../help/figures/lifecycle-experimental.svg" alt='[Experimental]' /></a> </p> <p>Names of columns to show preferentially if space is tight.</p> </td></tr> </table> <h3>Details</h3> <p>Extend this method to prepare information that is used in several parts of the printed output of a tibble-like object, or to collect additional arguments passed via <code>...</code> to <code><a href="format_tbl.html">print.tbl()</a></code> or <code><a href="format_tbl.html">format.tbl()</a></code>. </p> <p>We expect that <code>tbl_format_setup()</code> is extended only rarely, and overridden only in exceptional circumstances, if at all. If you override this method, you must also implement <code><a href="tbl_format_header.html">tbl_format_header()</a></code>, <code><a href="tbl_format_body.html">tbl_format_body()</a></code>, and <code><a href="tbl_format_footer.html">tbl_format_footer()</a></code> for your class. </p> <p>Implementing a method allows to override printing and formatting of the entire object without overriding the <code><a href="../../base/html/print.html">print()</a></code> and <code><a href="../../base/html/format.html">format()</a></code> methods directly. This allows to keep the logic of the <code>width</code> and <code>n</code> arguments. </p> <p>The default method for the <code>"tbl"</code> class collects information for standard printing for tibbles. See <code><a href="new_tbl_format_setup.html">new_tbl_format_setup()</a></code> for details on the returned object. </p> <h3>Value</h3> <p>An object that can be passed as <code>setup</code> argument to <code><a href="tbl_format_header.html">tbl_format_header()</a></code>, <code><a href="tbl_format_body.html">tbl_format_body()</a></code>, and <code><a href="tbl_format_footer.html">tbl_format_footer()</a></code>. </p> <h3>Examples</h3> <pre> tbl_format_setup(palmerpenguins::penguins) </pre> <hr /><div style="text-align: center;">[Package <em>pillar</em> version 1.8.1 <a href="00Index.html">Index</a>]</div> </body></html>