atorus-research / Tplyr

https://atorus-research.github.io/Tplyr/
Other
95 stars 16 forks source link

Set multiple values (distinct_n, n) to set result order #153

Closed johanneswerner closed 9 months ago

johanneswerner commented 9 months ago

I am trying to set the order in a nested summary table. Ideally, I would like to sort first by number of subjects and second by number of events.

As far as I could see, set_result_order_var() only accepts one parameter. Is there a possibility to apply this sorting?

Thank you!

mstackhouse commented 9 months ago

Hi @johanneswerner!

I think your best bet is this vignette: https://atorus-research.github.io/Tplyr/articles/post_processing.html#highly-customized-sort-variables. The sorting settings within the layer aren't quite flexible enough select a variety of different values to sort off of.