Open atusy opened 5 years ago
I really like this! Thanks so much for suggesting this improvement (and providing an example implementation). I think this is something we could incorporate soon.
Going to close this as pack()
is probably not in common use these days.
Just to give one use case for pack()
. When dealing with several metrics that each come with a mean/sample size/confidence interval, packed columns for "Sensitivity" and "Specificity", for example, would itself be tibbles with columns "Estimate", "N", "CI". Packed columns help me to avoid name collisions and make it more convenient to move these grouped data around. And for display, I'm converting each of these to a tab_spanner.
Thanks @hhhh5 for presenting your use of it! I wasn’t sure at all whether that approach had much uptake. I’ll explore this a little and see what could be done in gt to automatically unpack and create spanners.
Upcoming tidyr has
pack
andunpack
to treat data frame columns. Supporting packed data can reduce callingtab_spanner
and will improve experience ingt
. Here's my prototype implementation.Created on 2019-07-07 by the reprex package (v0.3.0)