title: R concatenating two factors
body: <p>This is making me feel dumb, but I am trying to produce a single vector/df/list/etc (anything but a matrix) concatenating two factors.  Here's the scenario.  I have a 100k line dataset.  I used the top half to predict the bottom half and vice versa using <code>knn</code>.  So now I have 2 objects created by <code>knn predict()</code>.</p>
  
  <pre><code>&gt; head(pred11)
  [1] 0 0 0 0 0 0
  Levels: 0 1
  &gt; head(pred12)
  [1] 0 1 1 0 0 0
  Levels: 0 1
  &gt; class(pred11)
  [1] "factor"
  &gt; class(pred12)
  [1] "factor"
  </code></pre>
  
  <p>Here's where my problem starts:</p>
  
  <pre><code>&gt; pred13 &lt;- rbind(pred11, pred12)
  &gt; class(pred13)
  [1] "matrix"
  </code></pre>
  
  <p>There are 2 problems.  First it changes the 0's and 1's to 1's and 2's and second it seems to create a huge matrix that's eats all my memory.  I've tried messing with <code>as.numeric()</code>, <code>data.frame()</code>, etc, but can't get it to just combine the 2 50k factors into 1 100k one.  Any suggestions?</p>