I have a large data.frame that looks like this:
Statistic1 fdr1 Value1 Statistic2 fdr2 Value2
2 0.0001 Signif 1.8 0.001 Signif
0.3 0.13 0 5 0.5 0
1.5 0.01 Signif 0.4 0.009 Signif
I would like to split the data frame every 3 columns, for example Statistic1, fdr1 and Value1. Then sort each splitted data.frame by Statistic* column in descending order and take the first 20 row names of each sorted data.frames corresponding to the Signif label in column Value* of the sorted data.frame.
Desired output
> df1
> Statistic1 fdr1 Value1
> 2 0.0001 Signif
> 1.5 0.01 Signif
> Statistic2 fdr2 Value2
> 1.8 0.001 Signif
> 0.4 0.009 Signif
From each single data.frame I will take the first 20 row names.
Can anyone help me please?