I want to rearrange the table I have.
This is what I have (I deleted the data values out of it):
table
group phase mean_ketone sd max_daily_mean min_daily_mean amplitude
1 A a 4 ….
2 A b 7
3 A c 4
4 A d 7
5 B a 4
6 B b 5
7 B c 4
8 B d 5
I would like to arrange it similar to the table1 function, so that I have the group and the phases on top and then on the left side the variables. Something like this:
LC | SD
a | b | c | d | a | b | c | d
mean
SD
max
min
amplitude
I tried it with the cable function but could not figure out how to reach the goal.
user24932684 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.