title: R Script: Determine whether the script is run in the GUI or from command line
body: <p>Is it possible to determine - from within the script - whether the script is running in the R-GUI (specifically R.app on OS X) or whether it has been called from Terminal/command line (i.e. <code>R --vanilla -f script.R</code>)? If so, how is this possible?</p>
  
  <p>I'm asking because I have a script that can run parallelized (using the <code>doMC</code> library), which should not be used from the GUI. Sometimes I need to further process the data calculated in the script, so I'd like to call the script from the GUI on these occasions.</p>