title: Is there syntactic sugar to define a data frame in R
body: <p>I want to regroup US states by regions and thus I need to define a "US state" -> "US Region" mapping function, which is done by setting up an appropriate data frame.</p>
  
  <p>The basis is this exercise (apparently this is a map of the "Commonwealth of the Fallout"):</p>
  
  <p><a href="https://i.stack.imgur.com/o4iuD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o4iuD.jpg" alt="Commonwealth of the Fallout"></a></p>
  
  <p>One starts off with an original list in raw form:</p>
  
  <pre><code>Alabama = "Gulf"
  Arizona = "Four States"
  Arkansas = "Texas"
  California = "South West"
  Colorado = "Four States"
  Connecticut = "New England"
  Delaware = "Columbia"
  </code></pre>
  
  <p>which eventually leads to this R code:</p>
  
  <pre><code>us_state &lt;- c("Alabama","Arizona","Arkansas","California","Colorado","Connecticut",
  "Delaware","District of Columbia","Florida","Georgia","Idaho","Illinois","Indiana",
  "Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan",
  "Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire",
  "New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma",
  "Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee",
  "Texas","Utah","Vermont","Virginia","Washington","West Virginia ","Wisconsin","Wyoming")
  
  us_region &lt;- c("Gulf","Four States","Texas","South West","Four States","New England",
  "Columbia","Columbia","Gulf","Southeast","North West","Midwest","Midwest","Plains",
  "Plains","East Central","Gulf","New England","Columbia","New England","Midwest",
  "Midwest","Gulf","Plains","North","Plains","South West","New England","Eastern",
  "Four States","Eastern","Southeast","North","East Central","Plains","North West",
  "Eastern","New England","Southeast","North","East Central","Texas","Four States",
  "New England","Columbia","North West","Eastern","Midwest","North")
  
  us_state_to_region_map &lt;- data.frame(us_state, us_region, stringsAsFactors=FALSE)
  </code></pre>
  
  <p>which is supremely ugly and unmaintainable as the State -> Region mapping is effectively
  obfuscated.</p>
  
  <p>I actually wrote a Perl program to generate the above from the original list.</p>
  
  <p>In Perl, one would write things like:</p>
  
  <pre><code>#!/usr/bin/perl
  
  $mapping = {
  "Alabama"=&gt; "Gulf",
  "Arizona"=&gt; "Four States",
  "Arkansas"=&gt; "Texas",
  "California"=&gt; "South West",
  "Colorado"=&gt; "Four States",
  "Connecticut"=&gt; "New England",
  ...etc...etc...
  "West Virginia "=&gt; "Eastern",
  "Wisconsin"=&gt; "Midwest",
  "Wyoming"=&gt; "North" };
  </code></pre>
  
  <p>which <em>is</em> maintainable because one can verify the mapping on a line-by-line basis.</p>
  
  <p>There must be something similar to this Perl goodness in R?</p>