PrettyTables.jl icon indicating copy to clipboard operation
PrettyTables.jl copied to clipboard

Comparison with RStudio's `gt` package

Open greimel opened this issue 3 years ago • 8 comments

There's a pretty recent R package by RStudio to create pretty tables.

It seems to be pretty feature rich and well thought through. They introduce their own names for table parts. Here's a screenshot from the package README.

image

Most of the elements are already available in, or have been asked for PrettyTables.

  • [x] Title
  • [ ] Subtitle
  • [x] Column labels ("headers")
  • [ ] Spanner column label (FR #12)
  • [x] Stubhead label ("row name header")
  • [ ] Row groups (with labels)
  • [ ] Summary label, Summary cells (FR #115)
  • [ ] Footnotes, source notes (FR #115)

Introducing row groups might be interesting for printing GroupedDataFrames (cc @bkamins). Here's a screen shot from the RStudio blog

image

greimel avatar Jul 26 '22 08:07 greimel

This will be conveniently done when we add metadata to DataAPI.jl (and DataFrames.jl)

bkamins avatar Jul 26 '22 09:07 bkamins

Thank you very much for this information!

By the way, I will change what I called row name to row label, which seems much better :D

Everything seems doable to implement except the spanner column label. It is somewhat difficult to do in text backend.

ronisbr avatar Aug 01 '22 17:08 ronisbr

This diagram is missing support for hierarchical row labels like Pandas has

image

jariji avatar Dec 22 '22 19:12 jariji

I understand this is handled in the diagram above by groups.

bkamins avatar Dec 22 '22 19:12 bkamins

I am super keen on this gt Table equivalent in Julia. Based on this issue, it looks like this might already be possible with some elbow grease using PrettyTables and DataFrames? Do you know if this is true, and if so, are there any links that might help me get started?

Dale-Black avatar Dec 22 '22 22:12 Dale-Black

This diagram is missing support for hierarchical row labels like Pandas has

I also agree with @bkamins that this feature is equivalent to row group.

I am super keen on this gt Table equivalent in Julia. Based on this issue, it looks like this might already be possible with some elbow grease using PrettyTables and DataFrames? Do you know if this is true, and if so, are there any links that might help me get started?

You can have some of the features using PrettyTables.jl in text, HTML, and LaTeX. Is there any specific use case you have in mind?

ronisbr avatar Dec 23 '22 22:12 ronisbr

I have a bunch of small dataframes that I would like to group into a formatted table like the gt table diagram shows

Dale-Black avatar Dec 24 '22 01:12 Dale-Black