Posted By

jeff_jie on 02/07/10


Tagged

python R rpy2


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

gartenstuhl


access R objects in python


 / Published in: Python
 

使用rpy2访问R的对象

  1. >>> from rpy2 import robjects
  2. >>> r = robjects.r
  3. >>> print r['pi']
  4. [1] 3.141593
  5. >>> print r('pi')
  6. [1] 3.141593
  7. >>> print r.pi
  8. [1] 3.141593

Report this snippet  

You need to login to post a comment.