Open HenrikBengtsson opened 3 years ago
Is it possible to infer whether R was launched via Rscript?
Rscript
commandArgs()[1] does not convey this information. On Linux:
commandArgs()[1]
$ Rscript --vanilla -e "commandArgs()" [1] "/home/hb/shared/software/CBI/R-4.0.4/lib/R/bin/exec/R" [2] "--no-echo" [3] "--no-restore" [4] "--vanilla" [5] "-e" [6] "commandArgs()"
On MS Windows:
C:\Users\hb>Rscript --vanilla -e "commandArgs()" [1] "C:\\Program Files\\R\\R-4.0.3\\bin\\x64\\Rterm.exe" [2] "--no-echo" [3] "--no-restore" [4] "--vanilla" [5] "-e" [6] "commandArgs()"
Is it possible to infer whether R was launched via
Rscript
?commandArgs()[1]
does not convey this information. On Linux:On MS Windows: