title: applying a formula to every row in a dataframe using a loop/apply/lapply
body: <p>I have the following dataframe: </p>
  
  <pre><code>0.159774955 0.315950195 1.043728695 -0.013713845    0.300639692 0.089504862
  0.225828659 0.359430606 0.837824198 0.023545454 0.454365387 0.146044804
  0.200956642 0.284167712 0.741477338 0.095507608 0.380116007 0.108930805
  0.178781669 0.268168151 0.890674193 0.025867199 0.439498785 0.090581651
  0.259719853 0.253015856 0.733539294 -0.021271503    0.34807779  0.134256761
  0.237380703 0.259466053 0.438376163 -0.017622207    0.403244764 0.123988446
  0.255139392 0.249787728 0.429777131 0.003033289 0.357595856 0.135647263
  0.231928182 0.229371247 0.374830209 0.048649557 0.412691492 0.135958108
  </code></pre>
  
  <p>I want to apply the following resample code to every row:</p>
  
  <pre><code>replicate(6, mean(sample(one, 6, replace=TRUE)))
  </code></pre>
  
  <p>at the end I want the answers to be saved in an output dataframe. So basically the task is to run a resample function on every row of a dataframe and to save the output to a new dataframe in the most efficient manner.</p>
  
  <p>Can someone help me in writing a loop for this please</p>