title: Accessing a vector element by name in R when some names are duplicated
body: <p>I had the vector  <code>x&lt;-1:5</code> I named its elements (wrongly) <code>names(x)&lt;-rep(c(letters[1:4], "a"))</code>. How can I access the <em>last</em> element by name?
  <code>x["a"]</code> only return the first element named <code>"a"</code>.</p>