EVOLUTION-MANAGER
Edit File: formatting.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: Printing tibbles</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 formatting {tibble}"><tr><td>formatting {tibble}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Printing tibbles</h2> <h3>Description</h3> <p>One of the main features of the <code>tbl_df</code> class is the printing: </p> <ul> <li><p> Tibbles only print as many rows and columns as fit on one screen, supplemented by a summary of the remaining rows and columns. </p> </li> <li><p> Tibble reveals the type of each column, which keeps the user informed about whether a variable is, e.g., <code style="white-space: pre;"><chr></code> or <code style="white-space: pre;"><fct></code> (character versus factor). See <code>vignette("types")</code> for an overview of common type abbreviations. </p> </li></ul> <p>Printing can be tweaked for a one-off call by calling <code>print()</code> explicitly and setting arguments like <code>n</code> and <code>width</code>. More persistent control is available by setting the options described in <a href="../../pillar/html/pillar_options.html">pillar::pillar_options</a>. See also <code>vignette("digits")</code> for a comparison to base options, and <code>vignette("numbers")</code> that showcases <code><a href="num.html">num()</a></code> and <code><a href="char.html">char()</a></code> for creating columns with custom formatting options. </p> <p>As of tibble 3.1.0, printing is handled entirely by the <span class="pkg">pillar</span> package. If you implement a package that extends tibble, the printed output can be customized in various ways. See <code>vignette("extending", package = "pillar")</code> for details, and <a href="../../pillar/html/pillar_options.html">pillar::pillar_options</a> for options that control the display in the console. </p> <h3>Usage</h3> <pre> ## S3 method for class 'tbl_df' print( x, width = NULL, ..., n = NULL, max_extra_cols = NULL, max_footer_lines = NULL ) ## S3 method for class 'tbl_df' format( x, width = NULL, ..., n = NULL, max_extra_cols = NULL, max_footer_lines = NULL ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>Object to format or print.</p> </td></tr> <tr valign="top"><td><code>width</code></td> <td> <p>Width of text output to generate. This defaults to <code>NULL</code>, which means use the <code>width</code> <a href="../../pillar/html/pillar_options.html">option</a>.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Passed on to <code><a href="../../pillar/html/tbl_format_setup.html">tbl_format_setup()</a></code>.</p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>Number of rows to show. If <code>NULL</code>, the default, will print all rows if less than the <code>print_max</code> <a href="../../pillar/html/pillar_options.html">option</a>. Otherwise, will print as many rows as specified by the <code>print_min</code> <a href="../../pillar/html/pillar_options.html">option</a>.</p> </td></tr> <tr valign="top"><td><code>max_extra_cols</code></td> <td> <p>Number of extra columns to print abbreviated information for, if the width is too small for the entire tibble. If <code>NULL</code>, the <code>max_extra_cols</code> <a href="../../pillar/html/pillar_options.html">option</a> is used. The previously defined <code>n_extra</code> argument is soft-deprecated.</p> </td></tr> <tr valign="top"><td><code>max_footer_lines</code></td> <td> <p>Maximum number of footer lines. If <code>NULL</code>, the <code>max_footer_lines</code> <a href="../../pillar/html/pillar_options.html">option</a> is used.</p> </td></tr> </table> <h3>Examples</h3> <pre> print(as_tibble(mtcars)) print(as_tibble(mtcars), n = 1) print(as_tibble(mtcars), n = 3) print(as_tibble(trees), n = 100) print(mtcars, width = 10) mtcars2 <- as_tibble(cbind(mtcars, mtcars), .name_repair = "unique") print(mtcars2, n = 25, max_extra_cols = 3) print(nycflights13::flights, max_footer_lines = 1) print(nycflights13::flights, width = Inf) </pre> <hr /><div style="text-align: center;">[Package <em>tibble</em> version 3.1.8 <a href="00Index.html">Index</a>]</div> </body></html>