How to provide an expression for R from the command line, but stop R immediately after exiting?

I know how to run R from the command line and execute an expression (for example, R -e 'print("hello")' ) or take input from a file (for example, R -f filename.r ). However, in both cases, R starts the expression or commands in the file and then exits.

  • How to change the above so that R does not exit after running commands in a file or executing an expression?
+6
source share
1 answer

Put your script in a file called .Rprofile in the current directory. Then run R normally.

+4
source

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


All Articles