I am using rpy2-2.0.3.
I am using Python and R in the shared library and don't know if updating
them will cause problems to other people's scripts. But I will try to get
updated Python and R in my local directory and retry.
BTW, if i upgrade R, would rpy2 can find R? Or should i reinstall rpy2?
Thanks for looking into this!
On Tue, Apr 28, 2009 at 8:58 PM, laurent <lgaut...@gmail.com> wrote:
>
>
> Please specify your rpy2 version.
>
> I am running your code without segfault with
> rpy2-2.04 (to be released shortly)
> and
> R-2.9.0/Python 2.4.6
> R-2.9.0/Python 2.5.4
> R-2.9.0/Python 2.6.2
>
> Trying updating your Python version, then your R version. There were
> reports of people seeing mysterious segfault disappear with version
> R-2.8
>
> L.
>
>
> https://bitbucket.org/lgautier/rpy2/issue/6/segfault-when-calling-robjectsrtable
>
>
> On Tue, 2009-04-28 at 11:35 -0700, Kylee Kim wrote:
> > Hi,
> >
> >
> > I am getting segmentation fault error for robjects.r.table() and
> > trying to understand why this happens.
> > Here is simplified example.
> >
> >
> > import rpy2.robjects as robjects
> > r = robjects.r
> > mylist = ['a', 'a', 'b', 'd', 'b']
> > myNumList = [1,2,3,4]
> >
> >
> > print robjects.IntVector(myNumList)
> >
> >
> >
> > #>>> print robjects.IntVector(myNumList)
> > #[1] 1 2 3 4
> >
> >
> > print robjects.StrVector(mylist)
> >
> >
> > #>>> print robjects.StrVector(mylist)
> > #[1] "a" "a" "b" "d" "b"
> >
> >
> > print r.factor(robjects.StrVector(mylist))
> >
> >
> > #>>> print r.factor(robjects.StrVector(mylist))
> > #[1] a a b d b
> > #Levels: a b d
> >
> >
> > # Both of the following produce a segmentation fault error.
> > r.table(robjects.StrVector(mylist))
> > r.table(r.factor(robjects.StrVector(mylist)))
> >
> >
> > I want to pass output of r.table into r.barplot.
> >
> > r.barplot(r.table(robjects.StrVector(mylist)))
> >
> >
> >
> > My environments are:
> > Python 2.4.1
> >
> > R version 2.7.1 (2008-06-23)
> >
> >
> >
> > Any advise on usage of r.table() and r.barplot() is much appreciated.
> >
> >
> > Thanks in advance,
> > Kylee
> >
> >
> > p.s. here are some corresponding R outputs.
> > > mylist = c('a', 'a', 'b', 'd', 'b')
> > > mylist
> > [1] "a" "a" "b" "d" "b"
> > > table(mylist)
> > mylist
> > a b d
> > 2 2 1
> > > barplot(table(mylist))
> >
> ------------------------------------------------------------------------------
> > 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
>
>
------------------------------------------------------------------------------
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