title: R - transform column type where column name is variable
body: <p>pretty simple question, but I can't find an answer.
  Suppose I want to transform data frame column type from string to double, but column name is unknown at compile time, so I can't write like:</p>
  
  <pre><code>train &lt;- transform(train, columnName = as.double(columnName))
  </code></pre>
  
  <p>but if I write smth like this</p>
  
  <pre><code>varKnownAtRuntime &lt;- "columnName"
  train &lt;- transform(train, varKnownAtRuntime = as.double(varKnownAtRuntime))
  </code></pre>
  
  <p>It just appends column "varKnownAtRuntime" to my data frame, while I want to change type of train$columnName</p>