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 try to pickle the globalEnv, I get this error:
cPickle.PicklingError: Can't pickle <type 'rinterface.SexpEnvironment'>:
import of module rinterface failed


How have other people gone about storing their R objects?

Thanks!
brandon invergo



On Mon, 2009-04-06 at 11:29 -0400, Réjean Ducharme wrote:
> 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)
output = open('glm.pickle', 'w')
pickle.dump(fit, output)

 >>>  pickle.PicklingError: Can't pickle <type
'rinterface.SexpVector'>: 
it's not found as rinterface.SexpVector


Is there another way to save a Rpy2 object???

Thanks,
Rejean Ducharme


------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to