i have a dataframe with 25000 rows and 51 columns.
head(df) here ..... means n1 .....n51
chr1_12750000_12760000 2 8 7 3 5 7 15 11 ....... 10
chr11_11280000_11290000 8 6 7 8 7 12 10 10 ....... 10
chr9_21700000_21710000 2 2 0 0 2 3 1 0 ....... 0
chr1_162500000_162510000 0 2 2 3 4 3 4 3 ....... 4
chr11_53780000_53790000 9 7 4 3 3 2 3 6 ....... 8
chrX_157610000_157620000 5 10 5 8 17 13 15 9 ....... 11
chr4_134170000_134180000 0 0 1 0 1 0 3 2 ....... 2
chr1_62090000_62100000 8 15 15 16 7 9 10 20 ....... 6
chr2_16540000_16550000 5 1 3 6 7 10 9 8 ....... 0
chr6_57740000_57750000 2 2 1 2 1 2 4 4 ....... 5
In R, I'd like to perform the following calculations column per column.
for column n2(i)
- sort df in descending order according to n2(i)
- find the value at 1250 row
- divide all the value of the column with the value at row 1250
repeat above steps for n3 ... n51
Thanks in advance :)