R equivalent to `python -i`

痴心易碎 提交于 2019-12-20 02:41:38

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/37547362/r-equivalent-to-python-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!