title: Reference script variable in function
body: <p>I work on a script which I want to apply to multiple outcome variables which I try to define in the beginning of the script and then be able to modify it easily</p>
  <p>at the beginning I have something like</p>
  <pre><code>outcome_variable &lt;&lt;- &quot;parameter244&quot;
  </code></pre>
  <p>In most components of my script it works if I simply use outcome_variable from then on instead of parameter244 but in the following function it doesn't work – I think I have to escape the variable somehow...</p>
  <pre><code>index.training &lt;- createDataPartition(analyze_data.norm$outcome_variable, p = 0.8, list = FALSE) %&gt;% as.vector()
  </code></pre>
  <p>it works with</p>
  <pre><code>index.training &lt;- createDataPartition(analyze_data.norm$parameter244, p = 0.8, list = FALSE) %&gt;% as.vector()
  </code></pre>