Question

The following works in rpy2 2.0.6:

robjects.r('M = lm(...)')
M = robjects.r('M')
coefficients = M.r['coefficients'][0]

But after I upgraded to rpy2 2.3.8, the above fails with the message

AttributeError: 'ListVector' object has no attribute 'r'

What do I need to change to make this work in 2.3.8?

Was it helpful?

Solution

I am not certain that the code snippet you provide worked with rpy2-2.0.x

The documentation, section Introduction, is showing how to extract coefficients from linear models:

http://rpy.sourceforge.net/rpy2/doc-2.1/html/introduction.html#linear-models

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top