If this is my dataframe
Factors Group n Average Max Min
Calcium Above 1599 0.412 42.872 0.017
Calcium Below 1040 0.011 0.017 -0.01
Lead Above 1345 1.312 0.043 0.037
Lead Below 882 0.614 64.65 0.065
I am trying to reorganize this to summary format like this, not sure where to start. Any advice is appreciated. Thanks in advance.
Group
Factor Above Below
Calcium
n 1599(60.5%) 1040(39.4%)
Average 0.412 0.011
Max,Min 42.872,0.017 0.017,-0.01
Lead
n 1345(60.4%) 882(39.6%)
Average 1.312 0.614
Max,Min 0.043,0.037 64.65, 0.065
Not precisely the requested format, but pretty close.