<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;color:rgb(0,51,51)">Hello,</div><div class="gmail_default" style="font-family:tahoma,sans-serif;color:rgb(0,51,51)"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;color:rgb(0,51,51)">I d'like to shuffle row-wise, independently for each row :</div><div class="gmail_default" style="font-family:tahoma,sans-serif;color:rgb(0,51,51)"><br></div><div class="gmail_default"><pre class="gmail-lang-r gmail-prettyprint gmail-prettyprinted" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;background-color:rgb(239,240,241);word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit"><span class="gmail-pun" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px">></span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> dt1
a b c
</span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">1</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">1</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">1</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">0</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px">
</span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">2</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">1</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">0</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">0</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px">
</span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">3</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">0</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">1</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">0</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px">
</span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">4</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">0</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">0</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px"><font color="#7d2727">1</font></span></code></pre><pre class="gmail-lang-r gmail-prettyprint gmail-prettyprinted" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;background-color:rgb(239,240,241);word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit"><span class="gmail-lit" style="margin:0px;padding:0px;border:0px"><pre class="gmail-lang-r gmail-prettyprint gmail-prettyprinted" style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;width:auto;max-height:600px;overflow:auto;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;word-wrap:normal"><code style="margin:0px;padding:0px;border:0px;font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit"><span class="gmail-pun" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px">></span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> dt1
a b c
</span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">1</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">1</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> 0</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px"><font color="#7d2727">1</font></span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px">
</span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">2</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px"><font color="#7d2727">0</font></span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px"><font color="#7d2727">1</font></span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">0</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px">
</span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">3</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">0</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">1</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">0</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px">
</span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">4</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-pln" style="margin:0px;padding:0px;border:0px"><font color="#7d2727">1</font></span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">0</span><span class="gmail-pln" style="color:rgb(48,51,54);margin:0px;padding:0px;border:0px"> </span><span class="gmail-lit" style="color:rgb(125,39,39);margin:0px;padding:0px;border:0px">0</span></code></pre></span></code></pre>Is there a data.table way to do so ?</div><div class="gmail_default"><br></div><div class="gmail_default">Thanks, </div></div>