title: Select data frame values row-wise using a variable of column names
body: <p>Suppose I have a data frame that looks like this:</p>
  <pre><code>dframe = data.frame(x = c(1, 2, 3), y = c(4, 5, 6))
  #   x y
  # 1 1 4
  # 2 2 5
  # 3 3 6
  </code></pre>
  <p>And a vector of column names, one per row of the data frame:</p>
  <p><code>colname = c('x', 'y', 'x')</code></p>
  <p>For each row of the data frame, I would like to select the value from the corresponding column in the vector. Something similar to <code>dframe[, colname]</code> but for each row.</p>
  <p>Thus, I want to obtain <code>c(1, 5, 3)</code> (i.e. row 1: col &quot;x&quot;; row 2: col &quot;y&quot;; row 3: col &quot;x&quot;)</p>