>
> Hi,
>
> I've tried changing the conversion mode as suggested, however it will die
> at the r*_result = **cindex(x=prob, surv_time=survTIME,
> surv_even=survEVENT)* line. I don't know how often R methods have
> var.name , but if someone else has successfully run such a method before
> that would be good to know. My code works in R; even if I put it in an RPy
> module with no other code (and line for line as it was done in R) it fails.
> There has to be some conversion issue happening, but I don't know how to fix
> it. Additionally RPy2 hasn't solved the problem yet.
>
>
>
> On Fri, Apr 15, 2011 at 10:30 AM, Warnes, Gregory R. <
> gregory.war...@rochester.edu> wrote:
>
>> The issue is probably that your surv_time variable is being translated
>> ‘back’ into a python object.
>>
>>
>>
>> Try changing the conversion mode to NO_CONVERSION and explicitly
>> requesting conversion when you need to access the results in python. I.E.
>>
>>
>>
>> import rpy
>>
>> rpy.set_default_mode(rpy.NO_CONVERSION)
>>
>>
>>
>> # YOUR CODE HERE
>>
>>
>>
>> r_result = cindex(x=prob, surv_time=survTIME,
>> surv_even=survEVENT)
>>
>>
>>
>> py_result=result.as_py(rpy.BASIC_CONVERSION)
>>
>>
>>
>> -Greg
>>
>>
>>
>> *From:* Anamaria Crisan [mailto:a...@genomedx.com]
>> *Sent:* Friday, April 15, 2011 12:59 PM
>> *To:* rpy-list@lists.sourceforge.net
>> *Cc:* Peter
>> *Subject:* Re: [Rpy] Rpy and dot names
>>
>>
>>
>>
>>
>> I have one more point I would like to add.
>>
>>
>>
>> When I run all of the code in R, it works just fine. If I make a small
>> python file with exactly the code I ran in R, it gives me the 'not all
>> arguments have the same length' error. I will continue to check my code, but
>> I am suspicious that its having trouble with the surv_time variable and that
>> the interface is really excepting surv.time and there is some
>> mistranslation. I will also try using RPy2 to see if anything helps.
>>
>>
>>
>> Any further advice would be appreciated, but thanks for the help so far :
>> )
>>
>>
>>
>> On Fri, Apr 15, 2011 at 9:06 AM, Peter <rpy-l...@maubp.freeserve.co.uk>
>> wrote:
>>
>> On Fri, Apr 15, 2011 at 4:56 PM, Anamaria Crisan <a...@genomedx.com>
>> wrote:
>> > I am using just Rpy. Would RPy2 be the solution?
>> >
>>
>> Possibly - and in the long term it would be worth looking at,
>> but there are quite a few API changes to beware of.
>>
>> Back in rpy (v1), to run an R command like:
>>
>>
>> cindex(x=prob, surv.time=survTIME, surv.even=survEVENT)
>>
>> you should (as I recall) switch the dots to underscores in Python
>> for argument names etc:
>>
>>
>> cindex(x=prob, surv_time=survTIME, surv_even=survEVENT)
>>
>> This is because dots are used in Python to access the methods
>> and attributes of an object. Argument names can't have dots,
>> that is what the SyntaxError is trying to tell you.
>>
>> The fact you then get an "not all arguments have the same length"
>> suggests there is a secondary problem in your script. I'm not
>> familiar with the R package survcomp so I can't really guess.
>>
>> Peter
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Benefiting from Server Virtualization: Beyond Initial Workload
>> Consolidation -- Increasing the use of server virtualization is a top
>> priority.Virtualization can reduce costs, simplify management, and improve
>> application availability and disaster protection. Learn more about
>> boosting
>> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
>> _______________________________________________
>> rpy-list mailing list
>>
>> rpy-list@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rpy-list
>>
>>
>
--
Anamaria Crisan
Medical Genomics Research Associate
GenomeDx Biosciences Inc. | 201-1595 W. 3rd Ave, Vancouver, BC V6J 1J8
Off: 604-568-7570 | Fax: 866-505-5161
ana <http://goog_1098469627>@genomedx.com
www.genomedx.com
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list