Hi all,

Apolagize if this is a stupid question. When I run  the following script

import rpy2.robjects as robjects
x=[5.05,6.75,3.21,2.65]
y=[1.65,2.64,2.64,6.95]
print robjects.r.cor(x,y,method="spearman")

get the following message

Traceback (most recent call last):
  File
"C:\Python26\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
line 325, in RunScript
    exec codeObject in __main__.__dict__
  File "D:\rpy2_test_01.py", line 11, in <module>
    print robjects.r.cor(x,y,method="spearman")
  File "C:\Python26\lib\site-packages\rpy2\robjects\__init__.py", line 423,
in __call__
    res = super(RFunction, self).__call__(*new_args, **new_kwargs)
RRuntimeError: Error: is.atomic(y) is not TRUE

However the script

import rpy
x=[5.05,6.75,3.21,2.65]
y=[1.65,2.64,2.64,6.95]
print rpy.r.cor(x,y,method="spearman")
runs fine. I know that rpy and rpy2 syntax are different, but cannot find
what I'm doing wrong. Any help would be fantastic!
------------------------------------------------------------------------------
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to