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?
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?
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