[Rpy] [ rpy-Bugs-1548554 ] Numeric array of type Int0 causes rpy to segfault

2007-11-02 Thread SourceForge.net
Bugs item #1548554, was opened at 2006-08-29 06:06
Message generated for change (Comment added) made by sf-robot
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=453021&aid=1548554&group_id=48422

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: rpy
>Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: Reidar Strand Hagen (reidarst)
Assigned to: Gregory Warnes (warnes)
Summary: Numeric array of type Int0 causes rpy to segfault

Initial Comment:
On both Windows XP and Ubuntu Dapper, the following
code will cause RPY to segfault:

import Numeric, rpy
rpy.r.assign("foo",Numeric.array([1,2,3],Numeric.Int0))

--

[EMAIL PROTECTED]:~$ python
Python 2.4.3 (#2, Apr 27 2006, 14:43:58)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import Numeric, rpy
>>> Numeric.__version__
'24.2'
>>> rpy._rpy




[EMAIL PROTECTED]:~$ gdb python
GNU gdb 6.4-debian

[]

>>> import Numeric, rpy
[New Thread -1226024016 (LWP 4964)]
>>> rpy.assign("m",Numeric.array([1,2,3],Numeric.Int0))
Traceback (most recent call last):
  File "", line 1, in ?
AttributeError: 'module' object has no attribute 'assign'
>>> rpy.r.assign("m",Numeric.array([1,2,3],Numeric.Int0))

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1209632544 (LWP 4929)]
0xb73e4b6d in Rf_findVarInFrame3 () from
/usr/lib/R/lib/libR.so


--

>Comment By: SourceForge Robot (sf-robot)
Date: 2007-11-01 19:20

Message:
Logged In: YES 
user_id=1312539
Originator: NO

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).

--

Comment By: Gregory Warnes (warnes)
Date: 2007-10-17 20:24

Message:
Logged In: YES 
user_id=9316
Originator: NO

Fixed for Numeric, but still broken for NumPy.

--

Comment By: Nobody/Anonymous (nobody)
Date: 2007-02-09 16:43

Message:
Logged In: NO 

Try Numeric.Int  instead of Int0,  I ran you example using numarray
without Int0, just int worked great.  Is numarry supposed to even work with
rpy?  Works with Numeric.Int as well

--

Comment By: Nobody/Anonymous (nobody)
Date: 2007-02-09 16:41

Message:
Logged In: NO 

Try Numeric.Int  instead of Int0,  I ran you example using numarray
without Int0, just int worked great.  Is numarry supposed to even work with
rpy?

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=453021&aid=1548554&group_id=48422

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] [ rpy-Bugs-1602142 ] Problem to convert numeric array into matrix

2007-11-02 Thread SourceForge.net
Bugs item #1602142, was opened at 2006-11-24 00:15
Message generated for change (Comment added) made by sf-robot
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=453021&aid=1602142&group_id=48422

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: rpy
>Status: Closed
Resolution: Works For Me
Priority: 5
Private: No
Submitted By: none (whatsoever)
Assigned to: Gregory Warnes (warnes)
Summary: Problem to convert numeric array into matrix 

Initial Comment:

I'm working with a programm that converts a numeric array into a r-matrix.
In some R and Python versions it runs fine (e.g. python 2.4.3 and R 2.1.1)

In some versions ( e.g. R 2.2.3) the array is converted into a matrix with one 
column containing lists in each cell.

I'm using the module Numeric to create the array.

I solved this by converting the array into a vector and create a matrix with 
the number of rows of the array, but slows down the method.

My question:
Is this solved in the newest rpy-version or solved in any other way? 






--

>Comment By: SourceForge Robot (sf-robot)
Date: 2007-11-01 19:20

Message:
Logged In: YES 
user_id=1312539
Originator: NO

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).

--

Comment By: Gregory Warnes (warnes)
Date: 2007-10-17 19:37

Message:
Logged In: YES 
user_id=9316
Originator: NO

Provide numpy is installed, the current svn code seems to solve this
problem:

Python 2.3.5 (#1, Aug 19 2006, 21:31:42) 
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from rpy import *
>>> c1=[386,385,383]
>>> c2=[113,117,117]
>>> c=r.cbind(c1,c2)
>>> r.print_(c)
 [,1] [,2]
[1,]  386  113
[2,]  385  117
[3,]  383  117
array([[386, 113],
   [385, 117],
   [383, 117]])
>>> r.chisq_test(c)
{'observed': array([[386, 113],
   [385, 117],
   [383, 117]]), 'residuals': array([[ 0.12040922, -0.21958259],
   [-0.04825694,  0.0880031 ],
   [-0.07193539,  0.13118397]]), 'p.value': 0.9535284154083411,
'statistic': {'X-squared': 0.095172106446633542}, 'expected': array([[
383.64157229,  115.35842771],
   [ 385.94803464,  116.05196536],
   [ 384.41039307,  115.58960693]]), 'data.name': ['structure(c(386L,
385L, 383L, 113L, 117L, 117L), .Dim = c(3L, ', '2L))'], 'parameter': {'df':
2.0}, 'method': "Pearson's Chi-squared test"}
 

--

Comment By: Nobody/Anonymous (nobody)
Date: 2007-09-21 02:44

Message:
Logged In: NO 

We had this same problem:
>>> c1=[386,385,383]
>>> c2=[113,117,117]
>>> c=r.cbind(c1,c2)
>>> c
[[386, 113], [385, 117], [383, 117]]
>>> r.chisq_test(c)
rpy.RException: Error in any(x < 0) : the object (list) can not be coerced
to 'double'

We also tryied to create an array using Numeric and Numpy without success,
the function (chisq) keep reading a list of lists of integers instead of a
matrix.

Workaround suggested by Peter in [Rpy] mail list:
>>> c = [386,113,385,117,383,117]
>>> r.assign("x",c)
[386, 113, 385, 117, 383, 117]
>>> r(' chisq.test(matrix(x,nrow=3,ncol=2,byrow=TRUE))$p.value')
0.9535284154083411

Our Pc details:
* Processor Intel 32-bit
* Win 2000, 5.00.2195, Service Pack 4
* R2.5 & R2.4.1 (though we're using R2.4.1 for the tests)
* Numeric-24.2.win32-py2.4
* rpy-1.0-RC2.win32-R2.0.0-R-2.4.1-py2.4
* ActivePython 2.4.3 Build 11, Python 2.1 & Python 2.5 (yes 3 Python
version installed. We're using the v. 2.4.3 for the test)


--

Comment By: Jeffrey Chang (jchang)
Date: 2007-08-30 13:04

Message:
Logged In: YES 
user_id=12576
Originator: NO

I believe I am seeing this too.  I am unable to create matrices in R. 
This is on rpy 1.0RC3, R 2.5.1, python 2.5.1.

I do not understand the workaround described above, so am unable to test
whether that works on my setup.



>>> M = rpy.r.matrix([1, 2, 4, 5], 2, 2)
>>> M
array([[1, 4],
   [2, 5]])
>>> rpy.r.print_(M)
NULL
>>> rpy.r.print_(rpy.r.dim(M))
NULL
>>> rpy.r.print_(rpy.r.dim([[1, 2], [3, 4]]))
NULL
>>> rpy.r.print_([[1, 2], [3, 4]])
[[1]]
[1] 1 2

[[2]]
[1] 3 4

[[1, 2], [3, 4]]
>>> rpy.r.print_(rpy.r.length([[1, 2], [3, 4]]))
[1] 2
2
>>> rpy.r.print_(rpy.r.mode([[1, 2], [3, 4]]))
[1] "list"
'list'
>>> 


--

Comment By: Gregory Warnes (warnes)
Date: 2006-11-27 06:32

Message:
Logged In: YES 
user_id=9316
Originator: NO

These conversions should happen properly for all versions

[Rpy] problem importing rpy

2007-11-02 Thread Andrew Jones
When I try to import rpy I get the following messages:

Python 2.4.4 (#9, Oct 30 2007, 15:13:19)
[GCC 4.1.0 20060304 (Red Hat 4.1.0-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rpy
RHOME= /usr/local/lib/R
RVERSION= 2.6.0
RVER= 2060
RUSER= /home/emu/ajones
Loading Rpy version 2060 ..Error in dyn.load(file, ...) :
  unable to load shared library
'/usr/local/lib/R/library/methods/libs/methods.so':
  /usr/local/lib/R/library/methods/libs/methods.so: undefined symbol:
Rf_allocS4Object
Error in dyn.load(file, ...) :
  unable to load shared library
'/usr/local/lib/R/library/grDevices/libs/grDevices.so':
  /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol:
utf8locale
In addition: Warning message:
package "methods" in options("defaultPackages") was not found
Error in dyn.load(file, ...) :
  unable to load shared library
'/usr/local/lib/R/library/grDevices/libs/grDevices.so':
  /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol:
utf8locale
In addition: Warning message:
package grDevices in options("defaultPackages") was not found
Error in dyn.load(file, ...) :
  unable to load shared library
'/usr/local/lib/R/library/grDevices/libs/grDevices.so':
  /usr/local/lib/R/library/grDevices/libs/grDevices.so: undefined symbol:
utf8locale
In addition: Warning message:
package graphics in options("defaultPackages") was not found
Error in dyn.load(file, ...) :
  unable to load shared library
'/usr/local/lib/R/library/methods/libs/methods.so':
  /usr/local/lib/R/library/methods/libs/methods.so: undefined symbol:
Rf_allocS4Object
In addition: Warning message:
package stats in options("defaultPackages") was not found
During startup - Warning message:
package methods in options("defaultPackages") was not found
 Done.
Creating the R object 'r' ..  Done


I'm using R version 2.6.0 and rpy version 1.0RC3.  I'm running fedora core
5.  I compiled R with the --enable-R-shlib --enable-BLAS-shlib flags.  I've
tried removing R and rpy and recompiling both into a fresh install.  I've
also checked to make sure there wasn't an alternate version of R installed
that would be confusing things.  Is there something I am doing wrong?  Any
help would be appreciated.  Thanks,

Andrew
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] [ rpy-Bugs-1815901 ] crash when loading rpy 2051

2007-11-02 Thread SourceForge.net
Bugs item #1815901, was opened at 2007-10-18 17:57
Message generated for change (Comment added) made by timmichelsen
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=453021&aid=1815901&group_id=48422

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Closed
Resolution: Duplicate
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Gregory Warnes (warnes)
Summary: crash when loading rpy 2051

Initial Comment:
from the python interface I type:

>>> from rpy import * 

I get the following output:

RHOME=C:\Program Files\R\R-2.5.1
RVERSION= 2.5.1
RVER= 2051
RUSER= C:\Users\{My dir}
Loading the R DLL C:\Program Files\R\R-2.5.1\bin\R.dll .. Done.
Loading Rpy version 2051 ..

and then the python exits with NO error message

I am running Vista 32 bit, with python=2.5.1 and R-2.5.1 and 
rpy-1.0-RC3.win32-R2.0.0-R2.5.1-py2.5

Thanks

--

Comment By: Tim (timmichelsen)
Date: 2007-11-02 10:51

Message:
Logged In: YES 
user_id=1039835
Originator: NO

Is there any plan to release a fixed Windows package for this?

I also have this problem in Win XP.

--

Comment By: Gregory Warnes (warnes)
Date: 2007-10-18 21:20

Message:
Logged In: YES 
user_id=9316
Originator: NO

This should be fixed in the latest source code (available via svn).

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=453021&aid=1815901&group_id=48422

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list