gt() table with column comparisons

Following the documentation examples, I've had no trouble with building row group tables with gt() but am having some difficulty conceptualizing a column-group style.

What I'm envisioning is a list of characteristics (e.g., height, weight, gender, etc) for each row, and two (or more) columns with data for presenting comparisons.

              Subj1  Subj2  Subj3
Height           64     72     73
Weight          174    193    182   
Gender            F      M      M

I'm sure I'm just have an goofy mental block here, but would appreciate if anyone can give me a nudge. Thanks.

Got this resolved on my own by using pivot_wide to make my data frame mimic the table output I was looking for. Wondering if that's the best practice or whether I've sort of "cheated."

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.