Re: [Rpy] Pickling a Rpy2 object

2009-04-30 Thread laurent
This will not work for "anonymous" R objects, that R objects not having an associated symbol (e.g., x = rpy2.robjects.IntVector([1,2,3]) ). For what it's worth, pickling of low-level objects (rpy2.rinterface) is working in the tip on bitbucket (that's the dev branch for 2.1). It is using serializ

Re: [Rpy] Pickling a Rpy2 object

2009-04-29 Thread Brandon Invergo
FWIW, the solution I have for now is to use dump(ls(), file="") to get a deparsed string representation of all the objects in memory, which can then be pickled. I'm not having problems with it right now in any simple cases, but I can imagine there are situations where deparsing gets hairy, so being

Re: [Rpy] Pickling a Rpy2 object

2009-04-29 Thread Brandon Invergo
I'm trying to do something similar: I'd like to create a save file that includes the current state of the R environment. I don't want to create a separate file for the R environment via one of R's built-in commands, so I thought I'd pickle globalEnv alongside some other objects I'm pickling. When I

[Rpy] Pickling a Rpy2 object

2009-04-06 Thread Réjean Ducharme
Hi all, I'm using Rpy2 to train a logistic regressor (using the "glm" function in R), and I need to save the model for futher use. I naively try to use pickle, but I have an error message: import rpy2.robjects as robjects fit = robjects.r.glm(formula=f, family=robjects.r.binomial(), data=data) o