Conclusion of the interactive session R

How to run an R script to make a session be interactive. Documents at ?interative say that --ess and --interactive manage this, but I see no effect.

Window:

 C:\Program Files\R\R-3.0.1\bin>R -e "interactive()" --ess -s [1] FALSE 

Mac:

 $ R -e "interactive()" --interactive -s [1] FALSE 

Any thoughts?

EDIT: I assume it can crack the base namespace, which may work for some things (e.g. install.packages). But this is a bad excuse for a decision ...

 $ R -e "unlockBinding('interactive',as.environment('package:base'));assign('interactive',function() TRUE,envir=as.environment('package:base'));base::interactive()" --interactive -s [1] TRUE 
+6
source share
1 answer

This triggered our favorite littler Rscript alternative, and then I added a switch:

 edd@max :~$ r -p -e 'interactive()' [1] FALSE edd@max :~$ r -i -p -e 'interactive()' [1] TRUE edd@max :~$ 

It is possible that R on call, since you always set it to false.

+4
source

Source: https://habr.com/ru/post/948166/


All Articles