title: Robustness Check 50/50 sample split
body: <p>Hi guys I need to do a robustness check with my dataframe consisting of 811777 rows and 15 columns. To do the 50/50 sample split I want to add a column with the numbers 1 and 0 alternately. In the end I want to create one dataframe with only the rows that have a &quot;0&quot; in the last column and the other dataframe should consist of the rows that had a &quot;1&quot; in the last column.</p>
  <p>To add the column into my dataframe I have the code:</p>
  <pre><code>mydata$rec &lt;- 1
  </code></pre>
  <p>But with this code I only get &quot;1&quot; in my new column but I want 1 and 0 alternately in the last column. Does somebody know how I can do it?</p>
  <p>Thanks for ur help! :)</p>