title: Convert a three column dataframe into matrix
body: <p>This is a continuation of the question [<a href="https://stackoverflow.com/questions/29457111/get-frequency-using-two-groupings-in-a-dataframe/29457173?noredirect=1#comment47078767_29457173][1]">Get frequency using two groupings in a dataframe</a> </p>
  
  <p>I have a dataframe as follows:</p>
  
  <pre><code>Gene    Rptname   freq
  Gene1   Cha1      1
  Gene1   Cha2      1
  Gene1   Cha3      1
  Gene1   Cha4      1
  Gene2   Cha1      1
  Gene2   TH1       2
  Gene2   KI2       2
  Gene2   Cha4      2
  Gene2   Cha5      4
  </code></pre>
  
  <p>I would like to convert the dataframe into the following format</p>
  
  <pre><code>       Cha1  Cha2  Cha3  Cha4  Cha5  KI2  TH1
  
  Gene1   1     1     1     1      0    0    0
  Gene2   1     0     0     2      4    2    2
  </code></pre>
  
  <p>I've got a feeling this is a reshape data issue but I dont know how to reshape the data- </p>