title: How to get name from a value in an R vector with names
body: <p>I know that with a vector such as</p>
  
  <pre><code>v &lt;- c("MA", "NY", "PA")
  names(v) &lt;- c("Massachusetts", "New York", "Pennsylvania")
  </code></pre>
  
  <p>It is possible to get a value from a name using syntax such as</p>
  
  <pre><code>v["New York"]
  </code></pre>
  
  <p>But is it possible to get a name from a value (like the PHP key() function)? Thanks.</p>