formatting: Printing tibbles

formattingR Documentation

Printing tibbles

Description

One of the main features of the tbl_df class is the printing:

  • Tibbles only print as many rows and columns as fit on one screen, supplemented by a summary of the remaining rows and columns.

  • Tibble reveals the type of each column, which keeps the user informed about whether a variable is, e.g., ⁠<chr>⁠ or ⁠<fct>⁠ (character versus factor). See vignette("types") for an overview of common type abbreviations.

Printing can be tweaked for a one-off call by calling print() explicitly and setting arguments like n and width. More persistent control is available by setting the options described in pillar::pillar_options. See also vignette("digits") for a comparison to base options, and vignette("numbers") that showcases num() and char() for creating columns with custom formatting options.

As of tibble 3.1.0, printing is handled entirely by the pillar package. If you implement a package that extends tibble, the printed output can be customized in various ways. See vignette("extending", package = "pillar") for details, and pillar::pillar_options for options that control the display in the console.

Usage

## S3 method for class 'SingleCellExperiment'
print(x, ..., n = NULL, width = NULL)

Arguments

x

Object to format or print.

...

Passed on to tbl_format_setup().

n

Number of rows to show. If NULL, the default, will print all rows if less than the print_max option. Otherwise, will print as many rows as specified by the print_min option.

width

Width of text output to generate. This defaults to NULL, which means use the width option.

Value

Prints a message to the console describing the contents of the 'tidySingleCellExperiment'.

Examples

data(pbmc_small)
print(pbmc_small)


stemangiola/tidySCE documentation built on Dec. 20, 2024, 10:19 p.m.