I have a summary of my data in the form of data frame
V1 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14
1 CCL5 P 0.000491 6546.2 P 0.000491 6546.2 P 0.000491 6546.2 P 0.000491 6546.2
2 EPHB3 P 0.000562 461.3 P 0.000562 461.3 P 0.000562 461.3 P 0.000562 461.3
3 GUCA1A A 0.602006 9.4 A 0.602006 9.4 A 0.602006 9.4 A 0.602006 9.4
4 HSPA6 P 0.000322 564.0 P 0.000322 564.0 P 0.000322 564.0 P 0.000322 564.0
5 PTPN21 A 0.204022 94.3 A 0.204022 94.3 A 0.204022 94.3 A 0.204022 94.3
6 UBA7 P 0.000468 845.6 P 0.000468 845.6 P 0.000468 845.6 P 0.000468 845.6
7 7-Mar P 0.000673 643.2 P 0.000673 643.2 P 0.000673 643.2 P 0.000673 643.2
I know very simple case of naming the columns by using something like
names(df)= c("Gene","Score","Call") ## df a data frame with three columns
But here the case is a bit different than simple case, where the first column is global which i want to assign name gene and after that for 2nd column call, for 3rd p-value, and forth intensity and repeat it till done.
The final output should look something like this
Gene call p-value intensity call p-value intensity call p-value intensity call p-value intensity
1 CCL5 P 0.000491 6546.2 P 0.000491 546.2 P 0.000491 6546.2 P .000491 6546.2
2 EPHB3 P 0.000562 461.3 P 0.000562 461.3 P 0.000562 461.3 P 0.000562 461.3
3 GUCA1A A 0.602006 9.4 A 0.602006 9.4 A 0.602006 9.4 A 0.602006 9.4
4 HSPA6 P 0.000322 564.0 P 0.000322 564.0 P 0.000322 564.0 P 0.000322 564.0
5 PTPN21 A 0.204022 94.3 A 0.204022 94.3 A 0.204022 94.3 A 0.204022 94.3
6 UBA7 P 0.000468 845.6 P 0.000468 845.6 P 0.000468 845.6 P 0.000468 845.6
7 7-Mar P 0.000673 643.2 P 0.000673 643.2 P 0.000673 643.2 P 0.000673 643.2
Edited: Column number is not known