Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable pillar formatting for tibble printing

Tags:

r

tibble

From version 1.4.1, tibble print method seems to be using additional formatting implemented by the pillar package (https://rdrr.io/cran/tibble/f/NEWS.md). The latter tries to output as many columns as possible, shortening some of the values. Is it possible to disable this formatting and go back to the print method that existed before? In some cases, by outputting the extra columns and shortening the values, pillar makes it difficult to read the contents of the first columns, which is often the analyst's intention.

It is difficult to provide a reproducible example, since the output and formatting would depend, I imagine, on the specifics of your particular display. I hope the question is straightforward enough as it is: how to disable pillar formatting of tibble printing (e.g. in console).

EDIT: The same question has been posited on tibble github repository: https://github.com/tidyverse/tibble/issues/361#issuecomment-357233716. It would seem that currently it is not really possible to disable the formatting. It is possible to provide some options, and the dev version of the package (at the time of this writing) does do a much better job of formatting. However, it is still not perfect, and may truncate important information (also see the issue the github discussion relates to). Therefore disabling the formatting is still something some users might want to achieve.

like image 871
Maxim.K Avatar asked Jan 09 '18 09:01

Maxim.K


People also ask

How do I print all columns in Tibble?

Use options(tibble. print_min = Inf) to always show all rows. Use options(tibble. width = Inf) to always print all columns, regardless of the width of the screen.

How do I print all Tibble rows?

Extending @BLT's answer, you can set n = Inf to print all rows. print (with a tibble) also has the width = and n_extra = options to control how many columns are printed, either directly or indirectly.

What option controls how many additional column names are printed at the footer of a Tibble?

What option controls how many additional column names are printed at the footer of a tibble? `options(tibble. width = Inf)` for all columns to be printed.

How do I show all rows in R?

options(tibble. width = Inf) # displays all columns. options(tibble. print_max = Inf) # to show all the rows.


1 Answers

With the development version of package pillar (with devtools::install_github("r-lib/pillar")), you can change options of the tibble formatting (see http://pillar.r-lib.org/reference/pillar-package.html#package-options).

If you change the options in your Rprofile, this will be permanent.

like image 72
F. Privé Avatar answered Sep 18 '22 06:09

F. Privé