title: Accessing element in named vector in R without variable name
body: <p>I am trying to access the value of an element in a named character vector in R.  Using the example in
  <a href="http://www.r-tutor.com/r-introduction/vector/named-vector-members" rel="nofollow">http://www.r-tutor.com/r-introduction/vector/named-vector-members</a>
  I tried the following:</p>
  
  <pre><code>v = c("Mary", "Sue")
  v
  [1] "Mary" "Sue"
  names(v) = c("First", "Last")
  v
   First   Last
  "Mary"  "Sue"
  v["First"]
   First
  "Mary"
  </code></pre>
  
  <p>I would like this to return "Mary" without the name "First" (and that is what is shown in the tutorial above), but when I try it always gives the name along with the value.  I tried to set it to a variable, hoping it would give just the value</p>
  
  <pre><code>&gt; teststr = v["First"]
  &gt; teststr
   First
  "Mary"
  &gt;
  </code></pre>
  
  <p>But I still get the variable name (First) along with the value.
  I tried the following, but it gives back the same - value along with the element name.</p>
  
  <pre><code>&gt;
  &gt; v[names(v)=="First"]
   First
  "Mary"
  &gt;
  </code></pre>
  
  <p>The data I have from my work project also produces the same results. 
  Would appreciate help with just getting "Mary" without "First".</p>
  
  <p>Thanks - Pankaj</p>