title: Running out of memory with merge
body: <p>I have a paneldata which looks like:</p>
  
  <p>(Only the substantially cutting for my question)</p>
  
  <pre><code>Persno 122 122 122 333 333 333 333 333 444 444 
  Income 1500 1500 2000 2000 2100 2500 2500 1500 2000 2200
  year 1990 1991 1992 1990 1991 1992 1993 1994 1992 1993
  </code></pre>
  
  <p>Now I would like to give out for every row (PErsno) the years of workexperience at the begining of the year.  I use <code>ddply</code> </p>
  
  <pre><code>hilf3&lt;-ddply(data, .(Persn0), summarize, Bgwork = 1:(max(year) - min(year)))
  </code></pre>
  
  <p>To produce output looking like this:</p>
  
  <pre><code>Workexperience: 1 2 3 1 2 3 4 5 1 2
  </code></pre>
  
  <p>Now I want to merge the <code>ddply</code> results to my original panel data:</p>
  
  <pre><code>data&lt;-(merge(data,hilf3,by.x="Persno",by.y= "Persno"))
  </code></pre>
  
  <p>The panel data set is very large. The code stops because of a memory size error.</p>
  
  <p>Errormessage:</p>
  
  <p>1: In make.unique(as.character(rows)) :</p>
  
  <p>Reached total allocation of 4000Mb: see help(memory.size)</p>
  
  <p>What should I do?</p>