title: Proportions test using values in columns of a dataframe
body: <p>So I'm stuck with something that would appear to be basic, but anyway. I've got the dataframe (Dat.f) below, and I need to run a proportions.test (Chi.squared) on Posgain.vector and Neggain.vector and extract the P value
  using the formula prop.test.</p>
  
  <p>if manually done using the first row as an example this will turn out to be</p>
  
  <pre><code> P&lt;-prop.test(x=c(4,4), n=c(16,10)[2]
  
    Posgain.vector Freq Neggain.vector Freq.1 PosRef NegRef
  1           A1BG    4           A1BG      4     16     10
  2       A1BG-AS1    4       A1BG-AS1      4     16     10
  3           A1CF    4           A1CF      1     16     10
  4            A2M    1            A2M      1     16     10
  5        A2M-AS1    1        A2M-AS1      1     16     10
  6          A2ML1    1          A2ML1      1     16     10
  </code></pre>
  
  <p>The trouble is I can't quite figure out how to apply this function to each row so it pastes in the second and fourth columns on that row into x and applies the formula with n staying the same. </p>
  
  <p>Any help would be greatly appreciated.</p>