我在python shelve文件中得到了一些数据,我想把它传递给R进行绘图。我提取它的代码如下所示:
尝试通过单击块中的运行按钮或将光标放在块内并按Ctrl+Shift+Enter来执行此块。在
```{python}
import numpy as np
from numpy import ma, array
import shelve
MODEL = "May2016"
d = shelve.open('fits_shelve_' + MODEL)
hilldata = d['hilldata']
allchi = d['allchi']
aa = d['aa']
rr = d['rr']
names = d['names']
weight = d['weight']
weightc = d['weightc']
dl = d['dl']
vi = d['activatorM']
activatorM = d['activatorM']
activatorR = d['activatorR']
d.close()
```
我现在想把这些对象传递给R。有没有办法在Rnotebook中做到这一点?我知道SQL块也可能有类似的情况。在
我认为对于python/R交互,您必须将数据保存到一个块中的文件系统,然后在另一个块中读回它。在
http://rmarkdown.rstudio.com/authoring_knitr_engines.html#python
相关问题 更多 >
编程相关推荐