title: How to attach a simple data.frame to a SpatialPolygonDataFrame in R?
body: <p>I have (again) a problem with combining data frames in R. But this time, one is a SpatialPolygonDataFrame (<code>SPDF</code>)  and the other one is usual data.frame (<code>DF</code>). The <code>SPDF</code> has around 1000 rows the <code>DF</code> only 400. Both have a common column, QDGC</p>
  
  <p>Now, I tried  </p>
  
  <pre><code>oo &lt;- merge(SPDF,DF, by="QDGC", all=T)
  </code></pre>
  
  <p>but this only results in a normal data.frame, not a spatial polygon data frame any more.
  I read somewhere else, that this does not work, but I did not understand  what to do in such a case (has to do something with the ID columns, merge uses)</p>
  
  <p>oooh such a hard question, I quess...</p>
  
  <p>Thanks!
  Jens</p>