title: Assign specific value and a specific name to a factor level
body: <p>Is it possible to assign a specific value and a specific name to a factor level? </p>
  
  <p>For example: I have a factor with more than 300 regional values (with a specific 5-digit regional code and the name of the region) </p>
  
  <p>With <code>as.numeric(substr(region, 1, 5))</code> I get a new numeric variable with the regional code. </p>
  
  <p>It works fine, but I already have a huge dataset (without <code>data.table</code> it wouldn't work) and there are some other variables, where I also need a specific code and the name.</p>
  
  <p>Ist there a way to put the code number and the name in one factor (or another sort of column)?</p>
  
  <p>Edit: Example of columns (the first 4 and the last 4 - imported from SPSS)</p>
  
  <pre><code>1002  KS Kiel                                             
  1003  KS Luebeck 
  1051  Dithmarschen                                    
  1053  Herzogtum Lauenburg 
  .
  .
  .                                
  16073  Saalfeld-Rudolstadt 
  16074  Saale-Holzland-Kreis, KS Jena                               
  16075  Saale-Orla-Kreis, Greiz 
  16077  Altenburger Land               
  </code></pre>
  
  <p>And now I also want to address only the code numbers (1002 - 16077) to create some  regional aggregations. </p>