Closed shajoezhu closed 2 years ago
The issue is actually not with rlistings per se (though there were other problems I had to fix to run this code, so I'm not really sure how you were doing it, I suspect you have an (possibly very) out of date copy of formatters
installed wherever you were trying this.
That said, the issue is actually that var_labels<-
is purely positional, and you're giving the labels in an order other than the one the columns appear in.
So rlistings
is actually doing the fully correct thing, using the column labels formatters
incorrectly placed. I will fix this in formatters
.
I see! Thanks for the explanation. I understand, I was wondering which way do you think is a sensible work flow
After the fix to formatters (ie formatters >= 0.3.2.5) var_labels no longer needs to be in the same order as the df columns, and var_label order has not and never will dictate order of the columns, so it should be irrelevant if you set them before or after sorting the columns.
On Mon, Aug 15, 2022 at 6:21 PM Joe Zhu @.***> wrote:
I see! Thanks for the explanation. I understand, I was wondering which way do you think is a sensible work flow
- sort the column order, then call the var_labels setter, or
- call the var_labels setter, and sort the column order
— Reply to this email directly, view it on GitHub https://github.com/insightsengineering/rlistings/issues/8#issuecomment-1216039063, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG53MLMNJMEPJHKS5IEMUDVZLUJ7ANCNFSM56MCJWKA . You are receiving this because you modified the open/close state.Message ID: @.***>
Table design from DSL01 design template. Formatting changes applied to initial design.
@shajoezhu when this listing is created, the column names (cols 2, 5, 6) appear in the wrong order (contents of columns are in the correct places).
Listing Code:
Output Listing:
Originally posted by @edelarua in https://github.com/insightsengineering/sme-tasks/issues/327#issuecomment-1203158410