Disable pillar formatting for tibble printing

风格不统一 提交于 2020-05-11 04:07:17

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/48165457/disable-pillar-formatting-for-tibble-printing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!