title: Transforming a data frame
body: <p>I have a Data Frame in R that looks like this with about 7k rows.</p>
  
  <pre><code>Customer ID  Test_Control DF    Purchase 
  1112223333      test      ab     False  
  2222223333      Control   ab     False
  3332223333      Control   ab     True
  4442223333      test      ab     False
  </code></pre>
  
  <p>About the data:</p>
  
  <ul>
  <li>All of the Customer_ID's are unique.</li>
  <li>The "Purchase" columns are either True or false</li>
  <li>The "Test_Control" column is either "test" or "Control"</li>
  <li>The DF column alway has "ab"</li>
  </ul>
  
  <p>I need to transform it to look like this:</p>
  
  <pre><code>Test     Control
  0        1
  0        1
  1        0 
  0        1
  </code></pre>
  
  <p>About the transformation:</p>
  
  <ul>
  <li>The Test_control column should be separated into two columns based off if it is Test or Control</li>
  <li>If the Purchase column it "False" it should be a 0 for both the "test" and "control" column</li>
  <li>If the Purchase column is 'True' then a "1" should go into either the "test" or "control" column. For example, If the "test_control" column is test then the 1 would go in the "test" column.</li>
  </ul>
  
  <p>Essentially, I am prepping this to fo a t.test().</p>