title: fast function for generating bootstrap samples in matrix forms in R
body: <p>I have a matrix <code>A</code>, and I would like to draw samples from each column of <code>A</code> and construct new matrices. For example:</p>
  
  <p><code>A = matrix(seq(1,9),3,3)</code></p>
  
  <p>so to get the 1st bootstrap matrix, I would sample with replacement (3 times) from the first column of <code>A</code>, i.e. 1,2,3, sample with replacement (3 times) from the second column of <code>A</code>, i.e. 4,5,6, and sample with replacement (3 times) from the third column of <code>A</code>, i.e. 7,8,9. After that, I re-construct the 1st bootstrap matrix B1 by combining the three bootstrap vectors. I will repeat this procedure for B=199 times, so that bootstrap matrices B1,...,B199 will be available.</p>
  
  <p>My question is, how can I make this program run faster? Which function should I use? I know <code>apply</code> involves essentially <code>for</code> loops so the speed is not guaranteed. How about <code>do.call</code>? Thanks!</p>