This is odd.
When looking at what is happening, the problem is likely rooted in
the use of deparse(substitute(x)) and deparse(substitute(y)) in the code
for chisq.test.
This is what is happening:
>>> f = robjects.r('''function(x) return(deparse(substitute(x)))''')
>>> tuple(f(robjects.FloatVect
Hi, List and Laurent,
For the chisq function I tried to used through rpy2, I just did
more test with the exact code as follows:
--
import rpy2.robjects as robjects
p1dist = []
p2dist = []
num = 17
for x in range(num):
p1dist.append(x)
p2dist
Hi, Laurent,
I test the "clean" code I you suggested. It works! You are right,
I also have a few other functions defined together with this chisq
calculation. Basicly they are file IOs written in normal python. So it
seems those parts caused the problem but not the rpy part. Thanks a lot
Hi Hao,
The exact example that triggers the error may matter.
I just tried the following with rpy2-2.1dev and it worked.
x = robjects.FloatVector((1,2,3))
y = robjects.FloatVector((2,3,4))
res = robjects.r['chisq.test'](x, y)
I only get the following
Warning message:
In function (x, y = NULL,
Hi, list
I would like to calculate the fitness of two histograms, so I tried
to use the chisq.test() in R through rpy2.
The python code I have is as follows:
---
import rpy2.robjects as robjects
p1dist = [X1, X2, ... Xm]
p2dist = [Y1, Y2, ... Ym]
rp1dist = robjects.FloatVec