title: Averaging two columns with partial matching in R (big size data)
body: <p>I have a matrix which has 562709 rows and 803 columns, and for the columns, it has 7 metadata and 796 replicates data which should be combined in pair and take the average.</p>
  
  <p>I googled the same problems but it didn't work well especially since my matrix is so huge, so I wonder if anybody can help me with this matter.</p>
  
  <pre><code> [1] "seqnames"                                                          
   [2] "start"                                                             
   [3] "end"                                                               
   [4] "name"                                                              
   [5] "score"                                                             
   [6] "annotation"                                                        
   [7] "GC"                                                                
   [8] "ACCx_025FE5F8_885E_433D_9018_7AE322A92285_X034_S09_L133_B1_T1_PMRG"
   [9] "ACCx_025FE5F8_885E_433D_9018_7AE322A92285_X034_S09_L134_B1_T2_PMRG"
  [10] "ACCx_2A5AE757_20D5_49B6_95FF_CAE08E8197A0_X012_S05_L033_B1_T1_P024"
  [11] "ACCx_2A5AE757_20D5_49B6_95FF_CAE08E8197A0_X012_S05_L034_B1_T2_P025"
  [12] "ACCx_3D0CD3BD_3960_46FB_92C3_777F11CCD0FC_X011_S06_L011_B1_T1_P024"
  [13] "ACCx_3D0CD3BD_3960_46FB_92C3_777F11CCD0FC_X011_S06_L012_B1_T2_P026"
  [14] "ACCx_4D0D43F5_D8F0_4735_92D5_F40E321C7A05_X010_S09_L065_B1_T1_P019"
  [15] "ACCx_4D0D43F5_D8F0_4735_92D5_F40E321C7A05_X010_S09_L066_B1_T2_P020"
  [16] "ACCx_81A262BD_3078_4BDB_8EB1_30DD6D7948C3_X027_S03_L081_B1_T1_P063"
  [17] "ACCx_81A262BD_3078_4BDB_8EB1_30DD6D7948C3_X027_S03_L082_B1_T2_P067"
  ...
  [800]"UCEC_C335297F_2D63_4973_9182_FA18C28E001E_X037_S04_L055_B1_T1_P088"
  [801]"UCEC_C335297F_2D63_4973_9182_FA18C28E001E_X037_S04_L056_B1_T2_P089"
  [802]"UCEC_D820B024_6B3B_4B5B_866E_F9A8139C270B_X039_S09_L113_B1_T1_P099"
  [803]"UCEC_D820B024_6B3B_4B5B_866E_F9A8139C270B_X039_S09_L114_B1_T2_P098"
  </code></pre>
  
  <p>Like above, the first 7 columns shouldn't be modified, but for the columns from 8, pair should be combined as their average. (eg. column 8,9 should be combined, and 10,11...)</p>