title: R: how do I prompt the user for input from the console?
body: <p>I am fairly new to R but I am struggling to run this using the CRAN development environment (R: 3.4.0). I want to be able to run scripts (in one go rather than line by line) that request two numbers to be inputted in at the console window. I have used readline as many posters have recommended elsewhere. The problem is, readline doesn't wait for user input; I'd expected, as was suggested in answers and documentation elsewhere, that this would behave like scanf in C but instead it just continues on regardless to the next line of code - you don't get a chance to input the data.</p>
  
  <pre><code>n1&lt;-readline(prompt="Enter skip 1: " )
  n2&lt;-readline(prompt="Enter skip 2: " )
  n1&lt;-as.integer(n1)
  n2&lt;-as.integer(n2)
  </code></pre>