I have forgotten one line before 'chisq_test = ro.r(code)':
code = ''.join(code)
L.
Hao Fan wrote:
> Cool, I will try the new source. Thanks a lot!
>
>
> Hao
>
>
>> This will not work.
>>
>> Since the problem was fixed in the R source, what about just using it ?
>>
>> # ---
>> import urll
Cool, I will try the new source. Thanks a lot!
Hao
>
> This will not work.
>
> Since the problem was fixed in the R source, what about just using it ?
>
> # ---
> import urllib
> page =
> urllib.urlopen("https://svn.r-project.org/R/branches/R-2-10-branch/src/library/stats/R/chisq.test.R";)
This will not work.
Since the problem was fixed in the R source, what about just using it ?
# ---
import urllib
page =
urllib.urlopen("https://svn.r-project.org/R/branches/R-2-10-branch/src/library/stats/R/chisq.test.R";)
code = page.readlines()
chisq_test = ro.r(code)
# this will now work
#
Hi, Laurent and list,
Thanks a lot for all the informations! I read through your
discussions at
https://stat.ethz.ch/pipermail/r-devel/2009-November/055701.html So it
is a R problem not rpy. :-)
I tried to work around this problem using the following code:
-
This seems fixed in R-devel (r50493), and the fix will be included
in R-2.10.1
L.
Laurent Gautier wrote:
>
> As suspected this is a problem in the R function chisq.test()
> (and this also at the R level).
>
> https://stat.ethz.ch/pipermail/r-devel/2009-November/055701.html
>
>
>
> L.
>
As suspected this is a problem in the R function chisq.test()
(and this also at the R level).
https://stat.ethz.ch/pipermail/r-devel/2009-November/055701.html
L.
Laurent Gautier wrote:
> This is odd.
> When looking at what is happening, the problem is likely rooted in
> the use of deparse(
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
11 matches
Mail list logo