R Script: Determine whether the script is run in the GUI or from command line

前端 未结 2 1981
生来不讨喜
生来不讨喜 2020-12-10 04:46

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/co

相关标签:
2条回答
  • 2020-12-10 05:11

    In C, you would use the isatty function. If you could find an equivalent function in R (probably in a UNIX or file system library), that should help.

    0 讨论(0)
  • 2020-12-10 05:17

    Perhaps you are looking for interactive()?

    0 讨论(0)
提交回复
热议问题