title: user input in R (Rscript and Widows command prompt)
body: <p>I am trying to figure out, how can i run an  r script, using <code>Rscript</code> in windows command prompt and ask for user input.</p>
  
  <p>So far, i have found answers on how do ask for user input in R's interactive shell. Any effort in doing the same with  <code>readline()</code> or <code>scan()</code> has failed.</p>
  
  <p>example:</p>
  
  <p>I have a polynomial <code>y=cX</code> where <code>X</code> can take more than one values <code>X1</code>,<code>X2</code>,<code>X3</code> and so on. <code>C</code> variable is know,  so what i need in order to calculate the value of <code>y</code> is to ask the user for the <code>Xi</code> values and store them somewhere inside my script.</p>
  
  <pre><code>Uinput &lt;- function() {
      message(prompt"Enter X1 value here: ")
      x &lt;- readLines()
  }
  </code></pre>
  
  <p>Is this the way to go? Any additional arguments? Will <code>as.numeric</code> help? How do i return <code>X1</code>? And will the implementation differ depending on the OS?</p>
  
  <p>Thanks.</p>