ESS and rpy2 sharing R in Emacs

I am a fairly new R user and started using Emacs Speaks Statistics (ESS). I also use rpy2 (the python interface for R), where I can run the R process in my ipython shell running in Emacs.

Is it possible to let ESS and rpy2 somehow use the same R process so that I can code a bit in Python / rpy2 to configure some R objects and then switch to ESS and run R commands directly without using python / rpy2?

For example, I either ran R inside Emacs using M-x R, and then in my ipython session, let it rpy2.robjects.rpoint to this running R process or use it; or, conversely, I run R in python with rp2.robjects.rand then get ESS to connect to the R process embedded in python.

I assume the problem is that the R process in rpy2 is embedded in the python interpreter, and also that the python objects representing the R objects will become “out of sync” if I can manipulate R directly without going through rpy2? I admit that I do not have a full understanding of how rpy2 and Emacs process processing works ...

+3
source share
2 answers

- - R, rpy2. .

, rpy2- R 'eval', python rpy2.eval() - . ..

R, ( "q()"!) python.

, , . 'manageR' Quantum GIS ( s/w) R, python rpy.

ESS , - ESS python R 'eval'. .

+2

Spacedman, R Python + rpy2.

"R" Emacs. , "Meta-x R" Emacs , "" R. ; , R- ess, python R, - -.

, rnumpy ( rpy2, rpy2-2.0.x, ). ipython R- Python ipython. ipython Emacs, ess-R R.

0

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


All Articles