title: Map given index from a vector to another one
body: <p>I do have to vectors</p>
  
  <pre><code>x &lt;- c(2,5,6) # index vector
  y &lt;- c(10:20)  # value vector
  </code></pre>
  
  <p>now, I have written a function giving me only the values from v2 descripted in v1. 
  Example return value (11,14,15)</p>
  
  <pre><code>mapIdxToVector &lt;- function(x,y) {
    ret &lt;- c(x);
    for( i in 1:length(x) ) {
      ret[i] &lt;- y[x[i]];
    }
    return(ret);
  }
  </code></pre>
  
  <p>Is there any fancy function in R to improve my own one?</p>
  
  <p>Sincerely
  Christian</p>