巨大的坑点,At the time of writing, rpy2这个包,3.x的版本还不支持windows

所以要安装2.x版本的

 

 

运行的时候先加这一句

%load_ext rpy2.ipython

 

%R 当前行切换为R语言模式

%%R 当前cell切换为R语言模式 

 

在jupyter notebook同时写python 和 R

 

  • -i data使用-i输入数据
  • -o data_out使用-o输出数据

即:

从R获取变量var:%R -o var

从Python获取变量var: %R -i var

在jupyter notebook同时写python 和 R

 

相关文章: