title: looping some simple division
body: <p>df</p>
  
  <pre><code>sampleName     realConc      exptname concentrate timepoints replicate    day  var
  name1_0     3.877049e-05           0hr        55mM          0        b1 011311   1
  name1_20    3.293085e-04           kcl        55mM         20        b1 011311   2
  name1_40    3.999433e-05           kcl        55mM         40        b1 011311   3
  name2_0     2.939995e-03           0hr        55mM          0        b1 011411   1
  name2_20    1.212584e-02           kcl        55mM         20        b1 011411   2
  name2_40    1.894434e-02           kcl        55mM         40        b1 011411   3
  </code></pre>
  
  <p>I want to divide every realConc value by the realConc value with a timepoint of 0 that has the has an equal day,replicate, and concentrate value</p>
  
  <p>I was trying a for loop, and not too much luck, can you help me out?</p>
  
  <pre><code>for (i in 1:dim(df)[1]){
  
  df$realConc &lt;- df$realConc[i] / df[which(duplicated(paste(replicate,day))) &amp; df$timepoint == 0,]$realConc[i]
  }
  </code></pre>
  
  <p>I was thinking something like this, but it obviously doesn't work </p>