When pasting into the console, spaces after command are causing issue <p>I have a simple line of code, with multiple readline commands that works just fine if I type it into the console directly, or paste it in from an existing R document without any excess spaces after the last bracket.</p> <pre><code>{ v1 &lt;- readline("Choose 1: "); v2 &lt;- readline("Choose 2: "); v3&lt;- readline("Choose 2: ")} </code></pre> <p>If I run the above line I will be asked to Choose 1, then Choose 2, then Choose 3. This example is simple, but it is how I like to enter a lot of my data.</p> <p>But if I inadvertently copy some empty spacing after the line of code when copying from an R document, or the above line is included with other code like so:</p> <pre><code>X&lt;-c(1,2,3,4,5) { v1 &lt;- readline("Choose 1: "); v2 &lt;- readline("Choose 2: "); v3&lt;- readline("Choose 2: ")} Y&lt;-c(1,2,3,4) </code></pre> <p>All three readline commands will be printed at once, so that I can't enter my data in.</p> <p>I've tried including the readline statements in a function, but I run into the same kind of problem with pasting spaces after the function call, causing the readline statements to all be printed out at once.</p> <pre><code>fun&lt;-function(){ v1 &lt;- readline("Choose 1: "); v2 &lt;- readline("Choose 2: "); v3&lt;- readline("Choose 2: ") } fun() Y&lt;-c(1,2,3,4) </code></pre> <p>The only luck I've had is to use source() to call a function from a separate R document, but I'm trying to avoid using source and keep everything in one R document. Ideally I'd like to be able to run multiple readline (or some other way to be asked to enter data), from a piece of code sandwiched in other code.</p>