title: Integer Variable Declaration in a Function in r
body: <p>I wrote a function which takes two integers variable(x,y) to define "id" array, however to get the correct output I had to change my variables (x and y like x&lt;-... and y&lt;-....) in the console.</p>
  
  <pre><code>test2 &lt;- function(s,id = x:y){ .... 
  </code></pre>
  
  <p>How can I change my variables to have a function which user could use just entering any two integers s/he wants like:</p>
  
  <pre><code>test2("char",10:20) without declaring x&lt;-10 and y&lt;-20
  </code></pre>
  
  <p>Thanks a lot!</p>