title: Create columns for each categoric value in R
body: <p>I have a df called &quot;homes&quot;, it has two columns: &quot;Education level&quot; and &quot;Insurance&quot;. Ed level is a categoric variable has four leves: Primary, High-Sch, Terciary and College. For instance:</p>
  <pre><code>Ed.Level. Insurance
  Primary.    YES
  Primary.    NO
  Primary.    NO
  College.    YES
  College.    YES
  High-Sch.   YES
  High-Sch.   NO
  Terc.       YES
  </code></pre>
  <p>I need to create a new column with name: Primary with values: YES, NO, etc. and the same logic for each education level.
  The expected output would be:</p>
  <pre><code>Primary. Secondary  High Sch  College
  YES.       NO.        YES.     NO
  NO.        YES.       NO.      YES
  YES.       YES        YES.     NO
  NO.        YES        YES.     YES
  </code></pre>
  <p>The values in the expected output are refered to the Insurance field.</p>
  <p>I tried with a transpose and didn't work, cbind, merges, but nothing worked.
  How can I do that?
  Thanks.</p>