title: How I can divide each column by a number in R?
body: <p>I have a dataset with 6000 columns which are gene names. It has 6 different features A,B,C,D,E,F with unique position numbers. I want to divide columns with feature A by 87 and feature B by 54. </p>
  
  <p>At the end I want to have the sum and average of each row in new columns.
  How I can do this in R? </p>
  
  <pre><code>feature_A=87
  feature_B=54
  </code></pre>
  
  <p>Input file</p>
  
  <pre><code> feature pos gene_1 gene_2 gene_3 gene_n
         A   1      6      2     51      0
         A   2      4      5      8      2
         A   3      1     74      5      0
         B   1     11      2     41     89
         B   2      4      5      3      5
  </code></pre>
  
  <p>Output file</p>
  
  <pre><code> feature pos gene_1 gene_2 gene_3 gene_n  sum_all  average_all
         A   1   6/87   2/87  51/87   0/87 sum_row1 average_row1
         A   2   4/87   5/87   8/87   2/87 sum_row2 average_row2
         A   3   1/87  74/87   5/87   0/87 sum_row3 average_row3
         B   1  11/54   2/54  41/54  89/54 sum_row4 average_row4
         B   2   4/54   5/54   3/54   5/54 sum_row5 average_row5
         B   3   4/54   0/54   5/54  21/54 sum_row6 average_row6
  </code></pre>