Re: getting Arrays and variables from R [fixed]
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: getting Arrays and variables from R [fixed]

From: Nicolas Lebas <bigfox@altern.org>
Date: Thu Jul 28 2005 - 00:13:20 CEST

Finally i found the solution in Rpy-list : there is a bug in
python2.4-rpy_0.4.1.

An alternative solution which works fine it's to use the R get(str)
function instead of using directly the variable (i.e r.tab) like that :

r.get('tab')

Nicolas Lebas a écrit :
> hello,
>
> i don't know if this is the best list to send this question, but i'm
> already trying to ask.
>
> I need to import variables from .RData files (arrays or variables).
> I'm trying to use the rpy module, but without success beccause when i
> try to access to a variable loaded from the .RData file i have a
> segmentation fault !
>
> This is what i'm doing :
> - in R-projet, i create a .RData file with some variables :
> > tab<-c(2,5,8,6)
> > v<-0.5
> > save.image("file.RData")
>
> - in Python :
> > from rpy import *
> > r.load("file.RData")
> ['tab', '.Traceback', 'v']
> > r.tab
> segmentation fault !
>
> I don't understand very well what does python crash.
>
> If someone has an idea to solve my problem or to give me a method which
> permit to import arrays and variables from .RData files with another module.
>
> Thanks
>
> Nicolas
Received on Thu Sep 29 17:12:08 2005