abalter
abalter

Reputation: 10393

R equivalent to `python -i`

Typing python -i file.py at the command line runs file.py and then drops into the python terminal preserving the run environment.

https://docs.python.org/3/using/cmdline.html

Is there an equivalent in R?

Upvotes: 3

Views: 1495

Answers (1)

Andrew Taylor
Andrew Taylor

Reputation: 3488

I may be misinterpreting what python -i file.py does, but try:

From inside R, at the terminal, you can do:

source('file.R')

and it will run file.R, with the global environment reflecting what was done in file.R

If you're trying to run from the command line, review this post

Upvotes: 2

Related Questions