title: Permute matrix columns in parallel with R
body: <p>I am trying to permute a matrix by columns using R.
  However, it is taking ages (the matrix is 68k x 32k integers).</p>
  
  <p>I would like to do it in parallel (since each column is permuted independently). How can I achieve it? It should be something related to embarrassingly parallel for in R but I didn't find a solution.</p>
  
  <p>Currently, my function is the following:</p>
  
  <pre><code>permMTX &lt;- function(x) {
      nr &lt;- nrow(x)
      nc &lt;- ncol(x)
      # I'd like to parallelize this for, since each
      # column can be permuted independently
      for (i in 1:nc) {
          x[,i] &lt;- x[sample(nr),i]
      }
      x
  } 
  </code></pre>