I'm having trouble with the following script:
#!/usr/bin/python
import sys, os, string
from rpy import *
r.library('zyp')
p = [11.3, -0.7, -17.6, -6.7, -3.0, -17.6, -6.2, 24.0, 25.9, -26.3, -19.3, 
-4.9, 5.5, -11.6, 6.6, -17.8]
t= [2.2, 2.4, 2.5, 1.7, 2.6, 2.8, 2.0, 2.9, 3.4, 3.7, 3.2, 3.2, 1.8, 2.3, 1.7, 
3.7]
slope1 = with_mode(NO_CONVERSION, r.zyp.sen)(r("p~t"))
s1=slope1['coefficients']['x']
int1=slope1['coefficients']['(Intercept)']
r.plot(x,y,ylim=(-30,30), xlim=(1,5))
r.abline(a=int1,b=s1)

I can get these commands to do what I want in R, but using Rpy returns:
Traceback (most recent call last):
  File "test1.py", line 9, in ?
    slope1 = with_mode(NO_CONVERSION, r.zyp.sen)(r("p~t"))
  File "/usr/lib/python2.4/site-packages/rpy.py", line 314, in __getattr__
    return self.__getitem__(name)
  File "/usr/lib/python2.4/site-packages/rpy.py", line 318, in __getitem__
    obj = self.__dict__[name] = self.__dict__.get(name, self.get(name)) 
rpy.RPy_RException: Error in function (x, pos = -1, envir = 
as.environment(pos), mode = "any",  : 
  object 'zyp' not found

I assume I'm just not getting the syntax right. Any suggestions?
 
Thanks,
Ed

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to