title: How to read different data types as user input in R?
body: <p>Hi I am new to R programming and trying to read different data types as user input. I tried the scan() as follows</p>
  <pre><code>print(&quot;Arithmetic Operations&quot;)
  print(&quot;a.Addition \t b.subtraction \t c.division \t d.multiplication&quot;)
  print(&quot;enter two values and your choice &quot;)
  input &lt;- scan() 
  </code></pre>
  <p>But it shows the following error
  Error in scan() : scan() expected 'a real', got 'a'</p>
  <p>Can anyone suggest how to rectify this? Thanks in advance.</p>