title: How to create an interactive script in R to simplify/partly automate the data exploration part?
body: <p>I would like to make an interactive menu in R - that interacts with me and then performs the selected tasks...I did some googling on interactive R / R user menu / etc. but nothing really helped. </p>
  
  <p>I would like to present myself with the following interactive menu</p>
  
  <ol>
  <li>clear all memory</li>
  <li>load data</li>
  <li>run regression model</li>
  <li>run cluster model
  Make a choice please (1,2,3 or 4):</li>
  </ol>
  
  <p>based on the selection it would ask additional input (eg. after option 2, load data it would give all the files present in the data/in directory under my project prepended with a number so I could choose which file to load by simply entering 1,2,3, etc.</p>
  
  <p>I do prepare different datasets to run with my script (for different segments or scenarios) and would like to quickly switch between these. eg. business operational plan Oct'12, consumer budget plan, etc. Also I would not like to reload my data over and over again..</p>
  
  <p>I was thinking of building something 'pseudocode' like</p>
  
  <pre><code>print the menu
  ask user for input
  ifelse(menuinput==1, source(script1.r),
        ifelse(menuinput== 2,source(script2.r),
        ifelse(menuinput==3,source(script3.r),NA)))
  </code></pre>
  
  <p>But I am not sure if there are easier ways to do this.</p>
  
  <p>Thanks,</p>
  
  <p>Geoffrey</p>