7
7
# ' supplemented by a summary of the remaining rows and columns.
8
8
# ' * Tibble reveals the type of each column, which keeps the user informed about
9
9
# ' whether a variable is, e.g., `<chr>` or `<fct>` (character versus factor).
10
+ # ' See `vignette("types", package = "pillar")` for an overview of common
11
+ # ' type abbreviations.
10
12
# '
11
13
# ' Printing can be tweaked for a one-off call by calling `print()` explicitly
12
14
# ' and setting arguments like `n` and `width`. More persistent control is
13
- # ' available by setting the options described below .
15
+ # ' available by setting the options described in [pillar_options] .
14
16
# ' See also `vignette("digits", package = "pillar")` for a comparison to base options,
15
17
# ' and [num()] and [char()] for creating columns with custom formatting options.
16
18
# '
17
19
# ' As of tibble 3.1.0, printing is handled entirely by the \pkg{pillar} package.
18
- # ' If you implement a package that extend tibble,
20
+ # ' If you implement a package that extends tibble,
19
21
# ' the printed output can be customized in various ways.
20
- # ' See `vignette("extending", package = "pillar")` for details.
21
- # '
22
- # ' @inherit pillar::pillar_options
23
- # ' @section Package options:
24
- # '
25
- # ' The following options control printing of `tbl` and `tbl_df` objects:
26
- # '
27
- # ' * `tibble.print_max`: Row number threshold: Maximum number of rows printed.
28
- # ' Set to `Inf` to always print all rows. Default: 20.
29
- # ' * `tibble.print_min`: Number of rows printed if row number threshold is
30
- # ' exceeded. Default: 10.
31
- # ' * `tibble.width`: Output width. Default: `NULL` (use `width` option).
32
- # ' * `tibble.max_extra_cols`: Number of extra columns printed in reduced form.
33
- # ' Default: 100.
34
- # '
35
- # ' The output uses color and highlighting according to the `"cli.num_colors"` option.
36
- # ' Set it to `1` to suppress colored and highlighted output.
22
+ # ' See `vignette("extending", package = "pillar")` for details,
23
+ # ' and [pillar_options] for options that control the display in the console.
37
24
# '
25
+ # Copied from pillar::format.tbl() to avoid roxygen2 warning
38
26
# ' @param x Object to format or print.
39
- # ' @param ... Other arguments passed on to individual methods .
27
+ # ' @param ... Passed on to [tbl_format_setup()] .
40
28
# ' @param n Number of rows to show. If `NULL`, the default, will print all rows
41
- # ' if less than option `tibble.print_max`. Otherwise, will print
42
- # ' `tibble.print_min` rows.
29
+ # ' if less than the `print_max` [option][pillar_options].
30
+ # ' Otherwise, will print as many rows as specified by the
31
+ # ' `print_min` [option][pillar_options].
43
32
# ' @param width Width of text output to generate. This defaults to `NULL`, which
44
- # ' means use `getOption("tibble.width")` or (if also `NULL`)
45
- # ' `getOption("width")`; the latter displays only the columns that fit on one
46
- # ' screen. You can also set `options(tibble.width = Inf)` to override this
47
- # ' default and always print all columns, this may be slow for very wide tibbles.
48
- # ' @param n_extra Number of extra columns to print abbreviated information for,
49
- # ' if the width is too small for the entire tibble. If `NULL`, the default,
50
- # ' will print information about at most `tibble.max_extra_cols` extra columns.
33
+ # ' means use the `width` [option][pillar_options].
34
+ # ' @param max_extra_cols Number of extra columns to print abbreviated information for,
35
+ # ' if the width is too small for the entire tibble. If `NULL`,
36
+ # ' the `max_extra_cols` [option][pillar_options] is used.
37
+ # ' The previously defined `n_extra` argument is soft-deprecated.
38
+ # ' @param max_footer_lines Maximum number of footer lines. If `NULL`,
39
+ # ' the `max_footer_lines` [option][pillar_options] is used.
40
+ # '
51
41
# ' @examples
52
42
# ' print(as_tibble(mtcars))
53
43
# ' print(as_tibble(mtcars), n = 1)
70
60
71
61
# Only for documentation, doesn't do anything
72
62
# ' @rdname formatting
73
- print.tbl_df <- function (x , ... , n = NULL , width = NULL , n_extra = NULL ) {
63
+ print.tbl_df <- function (x , width = NULL , ... , n = NULL , max_extra_cols = NULL ,
64
+ max_footer_lines = NULL ) {
74
65
NextMethod()
75
66
}
76
67
77
68
# Only for documentation, doesn't do anything
78
69
# ' @rdname formatting
79
- format.tbl_df <- function (x , ... , n = NULL , width = NULL , n_extra = NULL ) {
70
+ format.tbl_df <- function (x , width = NULL , ... , n = NULL , max_extra_cols = NULL ,
71
+ max_footer_lines = NULL ) {
80
72
NextMethod()
81
73
}
82
74
@@ -90,7 +82,18 @@ format.tbl_df <- function(x, ..., n = NULL, width = NULL, n_extra = NULL) {
90
82
# ' the printed output can be customized in various ways.
91
83
# ' See `vignette("extending", package = "pillar")` for details.
92
84
# '
93
- # ' @inheritParams formatting
85
+ # ' @param x Object to format or print.
86
+ # ' @param n Number of rows to show. If `NULL`, the default, will print all rows
87
+ # ' if less than option `tibble.print_max`. Otherwise, will print
88
+ # ' `tibble.print_min` rows.
89
+ # ' @param width Width of text output to generate. This defaults to `NULL`, which
90
+ # ' means use `getOption("tibble.width")` or (if also `NULL`)
91
+ # ' `getOption("width")`; the latter displays only the columns that fit on one
92
+ # ' screen. You can also set `options(tibble.width = Inf)` to override this
93
+ # ' default and always print all columns, this may be slow for very wide tibbles.
94
+ # ' @param n_extra Number of extra columns to print abbreviated information for,
95
+ # ' if the width is too small for the entire tibble. If `NULL`, the default,
96
+ # ' will print information about at most `tibble.max_extra_cols` extra columns.
94
97
# ' @export
95
98
# ' @keywords internal
96
99
trunc_mat <- function (x , n = NULL , width = NULL , n_extra = NULL ) {
0 commit comments