Skip to content

Redesign tibble formatting #235

Description

@krlmlr

with the following goals:

  • extensibility
  • clear responsibility between tibble, dplyr, and others
  • separate printing/formatting of individual components (header, footer, ...)
  • separation of the logic for formatting the columns
  • support for format()
  • configurable formatting for the body (and perhaps also header/footer)
  • format() and print(): full support for Unicode everywhere
  • glimpse(): full support for Unicode everywhere
  • support for both dplyr 0.5.0. and dplyr 0.6.0

Something like:

  1. We implement print() by forwarding to format()
  2. format.tbl_df() calls format_head(), format_body() and format_extra(), default implementations are provided for tibbles
    • we cannot rely on format.data.frame() because it returns a data frame and not a character vector
  3. dplyr needs to implement only format_head() for grouped data frames, and can append its information to the result of NextMethod()

The current implementation is inflexible because it relies on format.data.frame(). Therefore, this issue is mostly about replacing format.data.frame() with our own implementation.

We should release just before the dplyr release. I'll be closing a few related issues with a reference to this new issue.

@hadley: Could you please comment?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions