title: R Shuffle and randomize columns of a data table
body: <p>Given a <code>data.table</code> such as:</p>
  <pre><code>data.table::data.table(a = c(1,2,3), b = c(&quot;red&quot;,&quot;blue&quot;,&quot;yellow&quot;), c = c(TRUE, FALSE, TRUE), d = c(21, 45, 34, 26))
  
     a      b     c  d
  1: 1    red  TRUE 21
  2: 2   blue FALSE 45
  3: 3 yellow  TRUE 34
  4: 4  green FALSE 26
  </code></pre>
  <p>where <code>a</code> is a unique row identifier, how could I randomize/anonymize the data so that the columns shuffle within their own column. This would create a random <code>data.table</code> that looks something like:</p>
  <pre><code>   a      b     c  d
  1: 1  green  TRUE 26
  2: 2 yellow FALSE 45
  3: 3    red FALSE 21
  4: 4   blue  TRUE 34
  </code></pre>