[Rpy] SF.net SVN: rpy: [475] trunk/rpy/tests/test_robj.py

2008-04-03 Thread warnes
Revision: 475
  http://rpy.svn.sourceforge.net/rpy/?rev=475&view=rev
Author:   warnes
Date: 2008-04-03 16:26:50 -0700 (Thu, 03 Apr 2008)

Log Message:
---
Use failUnless / failUnlessRaises instead of assertTrue / assertRaises in 
test_robj.py for compatibility with python 2.3

Modified Paths:
--
trunk/rpy/tests/test_robj.py

Modified: trunk/rpy/tests/test_robj.py
===
--- trunk/rpy/tests/test_robj.py2008-03-30 19:34:18 UTC (rev 474)
+++ trunk/rpy/tests/test_robj.py2008-04-03 23:26:50 UTC (rev 475)
@@ -25,26 +25,26 @@
 pySeq = range(10, 50+step, step)
 d = r.seq(10, 50, by = step)
 for i in range(len(pySeq)):
-self.assertTrue(pySeq[i] == d[i])
-self.assertTrue(pySeq[-1] == d[-1])
+self.failUnless(pySeq[i] == d[i])
+self.failUnless(pySeq[-1] == d[-1])
 
 def testGetItemSlice(self):
 r.seq.autoconvert(NO_CONVERSION)
 step = 10
 pySeq = range(10, 50+step, step)
 d = r.seq(10, 50, by=step)
-self.assertTrue(pySeq[0:4] == d[0:4])
-self.assertTrue(pySeq[:4] == d[:4])
-self.assertTrue(pySeq[1:] == d[1:])
-self.assertTrue(pySeq[2:5] == d[2:5])
+self.failUnless(pySeq[0:4] == d[0:4])
+self.failUnless(pySeq[:4] == d[:4])
+self.failUnless(pySeq[1:] == d[1:])
+self.failUnless(pySeq[2:5] == d[2:5])
 # FIXME:
 # The one below deserves attention: a one-element slice
 # should return a one-element sequence.
 # However, the conversion system in RPy is making it 
 # somewhat problematic (or is it me ?)-- Laurent
-# self.assertTrue(pySeq[0:1] == d[0:1])
-self.assertRaises(IndexError, d.__getslice__, -1, 2)
-self.assertRaises(IndexError, d.__getslice__, 5, 2)
+# self.failUnless(pySeq[0:1] == d[0:1])
+self.failUnlessRaises(IndexError, d.__getslice__, -1, 2)
+self.failUnlessRaises(IndexError, d.__getslice__, 5, 2)
 
 def testKeywordParameters(self):
 r.list.autoconvert(BASIC_CONVERSION)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [484] trunk/rpy/src/rpymodule.c

2008-04-10 Thread warnes
Revision: 484
  http://rpy.svn.sourceforge.net/rpy/?rev=484&view=rev
Author:   warnes
Date: 2008-04-10 06:45:34 -0700 (Thu, 10 Apr 2008)

Log Message:
---
Correct the handling of CStackLimit code.

Modified Paths:
--
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2008-04-09 20:48:38 UTC (rev 483)
+++ trunk/rpy/src/rpymodule.c   2008-04-10 13:45:34 UTC (rev 484)
@@ -39,7 +39,15 @@
  *
  * * END LICENSE BLOCK * */
 
-#define CSTACK_DEFNS
+#include  
+#if (R_VERSION >= R_Version(2,3,0)) 
+
+#  ifndef _WIN32
+#define CSTACK_DEFNS // Enable definitions needed for stack checking 
control
+#  endif 
+
+#endif
+
 #include "RPy.h"
 
 #define NONAMELESSUNION
@@ -2014,7 +2022,7 @@
 #endif
 
 
-#ifndef CSTACK_DEFNS
+#ifdef CSTACK_DEFNS
   /* Disable C stack checking, which is incompatible with use as a
  shared library. */
   R_CStackLimit = (uintptr_t)-1; 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [485] trunk/rpy/src/rpymodule.c

2008-04-10 Thread warnes
Revision: 485
  http://rpy.svn.sourceforge.net/rpy/?rev=485&view=rev
Author:   warnes
Date: 2008-04-10 09:49:07 -0700 (Thu, 10 Apr 2008)

Log Message:
---
Use R's internal function to clean up R temporary directory for R 2.4.0 and 
later

Modified Paths:
--
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2008-04-10 13:45:34 UTC (rev 484)
+++ trunk/rpy/src/rpymodule.c   2008-04-10 16:49:07 UTC (rev 485)
@@ -1493,6 +1493,7 @@
   SEXP robj, e, index;
   PyObject *obj;
   int robjLen, sliceLen, c;
+  int ii;
   
   robjLen = Robj_len(a);
   
@@ -1529,7 +1530,7 @@
   /*   } */
   
   PROTECT(index = allocVector(INTSXP, sliceLen));
-  int ii;
+
   for (ii = 0; ii < sliceLen; ii++) {
 INTEGER_POINTER(index)[ii] = ii + ilow + 1;
   }
@@ -1777,17 +1778,22 @@
 R_dot_Last();   
 R_RunExitFinalizers();  
 CleanEd();  
-KillAllDevices();   
+KillAllDevices();
+
+#if (R_VERSION >= R_Version(2,4,0)) 
+R_CleanTempDir();
+#else
 if((tmpdir = getenv("R_SESSION_TMPDIR"))) {  
 
-#ifdef _WIN32
+#   ifdef _WIN32
   snprintf((char *)buf, 1024, "rmdir /S /Q %s", tmpdir); 
-#else
+#   else
   snprintf((char *)buf, 1024, "rm -rf %s", tmpdir);
-#endif
+#   endif
 
   R_system((char *)buf);
 }
+#endif 
 
 PrintWarnings();   /* from device close and .Last */
 R_gc();  /* Remove any remaining R objects from memory */
@@ -1797,7 +1803,7 @@
 static PyObject *
 r_cleanup(void)
 {
-  r_cleanup();
+  r_finalize();
   Py_INCREF(Py_None);
   return Py_None;
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [486] trunk/rpy/examples/nnet.py

2008-04-10 Thread warnes
Revision: 486
  http://rpy.svn.sourceforge.net/rpy/?rev=486&view=rev
Author:   warnes
Date: 2008-04-10 09:50:51 -0700 (Thu, 10 Apr 2008)

Log Message:
---
Add simple neural net example

Added Paths:
---
trunk/rpy/examples/nnet.py

Added: trunk/rpy/examples/nnet.py
===
--- trunk/rpy/examples/nnet.py  (rev 0)
+++ trunk/rpy/examples/nnet.py  2008-04-10 16:50:51 UTC (rev 486)
@@ -0,0 +1,29 @@
+from rpy import *
+
+# avoid automatic conversion
+set_default_mode(NO_CONVERSION)
+
+
+r.library("nnet")
+model = r("Fxy~x+y")
+
+df = r.data_frame(x = r.c(0,2,5,10,15)
+   ,y = r.c(0,2,5,8,10)
+   ,Fxy = r.c(0,2,5,8,10))
+
+NNModel = r.nnet(model, data = df
+  , size =10, decay =1e-3
+  , lineout=True, skip=True
+  , maxit=1000, Hess =True)
+
+XG = r.expand_grid(x = r.seq(0,7,1), y = r.seq(0,7,1))
+x = r.seq(0,7,1)
+y = r.seq(0,7,1)
+
+
+# turn automatic conversion back on
+set_default_mode(BASIC_CONVERSION)
+
+fit = r.predict(NNModel,XG)
+print fit
+


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [487] trunk/rpy

2008-04-10 Thread warnes
Revision: 487
  http://rpy.svn.sourceforge.net/rpy/?rev=487&view=rev
Author:   warnes
Date: 2008-04-10 09:51:42 -0700 (Thu, 10 Apr 2008)

Log Message:
---
Update for RPy release 1.0.2

Modified Paths:
--
trunk/rpy/NEWS
trunk/rpy/rpy_version.py

Modified: trunk/rpy/NEWS
===
--- trunk/rpy/NEWS  2008-04-10 16:50:51 UTC (rev 486)
+++ trunk/rpy/NEWS  2008-04-10 16:51:42 UTC (rev 487)
@@ -1,3 +1,38 @@
+CHANGES IN RPY 1.0.2 - 2008-04-02
+-
+
+New features:
+
+- The 'Robj' type is now exported.
+
+- Add simple neural net example.
+
+Bug fixes:
+
+- Stack checking code was incorrectly disabled on all platforms,
+  corrected so that it is properly included for R 2.3.0 and later
+  everywhere except Win32.
+
+- Fixes for compatibility with Python 2.4 and later.
+
+- Updates to debian install files (Dirk Eddelbuettel)
+
+- Correct simple line plot example in the documentation
+
+- Minor internal changes to code and tests
+
+- Automatic build tool now uses 'tail -n 1' instead of 'tail -1' when
+  calling 'R RHOME' to make recent versions of tail happy
+
+- Add startup options to prevent initialization of console
+  read/write/showfiles which causes problems with R when run without a
+  controlling console. 
+
+Other changes:
+
+- Deletion of R's temporary directory now uses R's own internal function
+  for this task for R versions after 2.4.0.
+
 CHANGES IN RPY 1.0.1 - 2007-11-29
 -
 

Modified: trunk/rpy/rpy_version.py
===
--- trunk/rpy/rpy_version.py2008-04-10 16:50:51 UTC (rev 486)
+++ trunk/rpy/rpy_version.py2008-04-10 16:51:42 UTC (rev 487)
@@ -1 +1 @@
-rpy_version = "1.0.1"
+rpy_version = "1.0.2"


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [489] trunk/rpy/rpy.py

2008-04-16 Thread warnes
Revision: 489
  http://rpy.svn.sourceforge.net/rpy/?rev=489&view=rev
Author:   warnes
Date: 2008-04-16 07:19:47 -0700 (Wed, 16 Apr 2008)

Log Message:
---
Fix R.__repr__() bug.

Modified Paths:
--
trunk/rpy/rpy.py

Modified: trunk/rpy/rpy.py
===
--- trunk/rpy/rpy.py2008-04-12 09:04:32 UTC (rev 488)
+++ trunk/rpy/rpy.py2008-04-16 14:19:47 UTC (rev 489)
@@ -332,7 +332,7 @@
 self.print_(helpobj)
 
 def __repr__(self):
-Rver = self.__getitem__('R_version_string')
+Rver = self.__getitem__('R.version.string')
 return "RPy version %s [%s]" % (rpy_version, Rver)
 
 def __str__(self):


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [502] trunk/htdocs/download.data

2008-04-24 Thread warnes
Revision: 502
  http://rpy.svn.sourceforge.net/rpy/?rev=502&view=rev
Author:   warnes
Date: 2008-04-24 06:59:59 -0700 (Thu, 24 Apr 2008)

Log Message:
---
Update Windows download/install instructions to recommend NumPy rather than 
Numeric

Modified Paths:
--
trunk/htdocs/download.data

Modified: trunk/htdocs/download.data
===
--- trunk/htdocs/download.data  2008-04-23 20:57:10 UTC (rev 501)
+++ trunk/htdocs/download.data  2008-04-24 13:59:59 UTC (rev 502)
@@ -37,12 +37,12 @@
 
 
 
-"Numeric" python module: 
+"NumPy" python module: 
 http://numpy.sf.net/";>Main page
-   http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=1351";>
+   http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103";>
   Downloads 
-Note that you need the Numeric module and
-not NumPy
+Note that you need the NumPy module and
+not Numeric

  
   


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [503] trunk/htdocs/plotting-with-RPy.html

2008-04-24 Thread warnes
Revision: 503
  http://rpy.svn.sourceforge.net/rpy/?rev=503&view=rev
Author:   warnes
Date: 2008-04-24 07:07:58 -0700 (Thu, 24 Apr 2008)

Log Message:
---
Remove auto-generated html file from SVN repository

Removed Paths:
-
trunk/htdocs/plotting-with-RPy.html

Deleted: trunk/htdocs/plotting-with-RPy.html
===
--- trunk/htdocs/plotting-with-RPy.html 2008-04-24 13:59:59 UTC (rev 502)
+++ trunk/htdocs/plotting-with-RPy.html 2008-04-24 14:07:58 UTC (rev 503)
@@ -1,284 +0,0 @@
-http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
-
-  
-Plotting with RPy 
-
-  
-  
-
-  
-  
-
-
-   
-
-  
-  
-  
-  
-   A simple and efficient access to R from Python 
-  
-  
-
-
-  
-  
-  
-  
-  
-
-
-
-
-
-  
-  
-  
-  
-Sections
-  
-  
-About
-http://rpy.wiki.sourceforge.net/";>Wiki
-Bugs
-SVN
-Download
-Documentation
-Demo
-FAQ
-Mail List
-News
-To do
-http://sourceforge.net/projects/rpy";>SourceForge
-  
-  
-  
-  
-
-  
-  
-  
-Exits
-  
-  
-http://www.python.org/";>Python
-http://www.r-project.org/";>R language
-http://www.omegahat.org/RSPython";>RSPython
-
-  
-  
-  
-  
-  
-  
-  
-Acknowledgement
-  
-  This site is hosted by   
-  http://sourceforge.net/projects/rpy";>
-  
-  
-  
-  
-  
-  
-  
-
- 
-  
-  
-
-  
-  
-  
-   RPy (R from Python) 
-  
-  
-  
-  
-  Plotting with RPy 
-  
-
-
-
-RPy (http://rpy.sf.net/";>rpy.sf.net) is a simple and
-easy-to-use http://www.python.org/";>Python interface for the
-http://www.r-project.org/";>R Programming Language.
-
-
-
-The advantage to using RPy for plotting is that R is a high-quality
-environment for doing statistics and math work that comes with many,
-many, many plotting features.  The disadvantage is that R
-is a large language with its own complexities.
-This page is a simple tutorial meant to get you to your first plot,
-and point you on your way towards your 2nd, 3rd, and Nth plots.
-
-Getting started
-
-To start, http://rpy.sourceforge.net/download.html";>install
-RPy.  (You'll probably need to http://cran.r-project.org/mirrors.html";>install R, too.)
-
-Now run Python, and enter the following code:
-
-
-from rpy import *
-
-x = range(0, 10)
-y = [ 2*i for i in x ]
-
-r.plot_default(x, y)
-
-
-Assuming everything was installed correctly, and R can connect to your
-display (this could be tricky if you're using a remote Linux box from
-a Windows machine -- talk to your local Linux expert, or install R
-locally!) you should see a simple graph that plots x vs 2*x for x ranging
-from 0 to 9.  This is what I see:
-
-
-
-
-Getting moderately tricky
-
-Let's plot multiple things, with lines, in different colors!
-(Exciting, ehh?)
-
-
-from rpy import *
-import math
-
-x = range(0, 10)
-y1 = [ 2*i for i in x ]
-y2 = [ math.log(i+1) for i in x ]
-
-r.plot_default(x, y1, col="blue", type="o")
-r.points(x, y2, col="red", type="o")
-
-You should see something like this:
-
-
-
-
-Axis labels and titles
-
-Finally, let's add some axis labels and a title.
-
-
-from rpy import *
-import math
-
-x = range(0, 10)
-y1 = [ 2*i for i in x ]
-y2 = [ math.log(i+1) for i in x ]
-
-r.plot_default(x, y1, col="blue", type="o")
-r.points(x, y2, col="red", type="o")
-
-xlabels = [ "#%d" % (i,) for i in x ]
-r.axis(1, at = x, label=xlabels, lwd=1, cex_axis=1.15)
-r.title("My Plot")
-
-
-
-
-
-
-Outputting to a file
-
-You can set things up to output to a file by putting either of
-these commands in front of the plot_default command:
-
-outfile = "somefile.ps"
-r.postscript(outfile, paper='letter')
-
-or
-
-outfile = "somefile.png"
-r.bitmap(outfile, res=200)
-
-
-The former writes a postscript file, and the latter writes a PNG file.
-Oh, and be sure to call r.dev_off before using the file -- that will
-flush any unwritten data.
-
-The End
-
-I'm afraid at this point we've exhausted my knowledge of R
-programming.  The next place to go is the http://cran.r-project.org/doc/rpys/R-intro.pdf";>R-intro,
-a short and readable introduction to using R.  You can skip right to
-the plotting section and use most of those commands directly from
-Python, as above.
-
-
-Hope that helps!
-
-Titus Brown [EMAIL PROTECTED]
-
-
-  
-  
-  
-  
-  
-  
-  
-  
-  
-
-News
-
-  
-  
-  RPy 1.0 RC 3 now available
- (2007-06-26) 
-  
-
-  
-  RPy 0.99.0 now available
- (2006-03-15) 
-  
-  
-  RPy now using Subversion
- (2006-02-28) 
-  
-  
-  RPy 0.4.6 now available
- (2005-07-28) 
- 

[Rpy] SF.net SVN: rpy: [506] trunk/htdocs

2008-04-28 Thread warnes
Revision: 506
  http://rpy.svn.sourceforge.net/rpy/?rev=506&view=rev
Author:   warnes
Date: 2008-04-28 12:53:52 -0700 (Mon, 28 Apr 2008)

Log Message:
---
Update news items from late 2007 to present

Modified Paths:
--
trunk/htdocs/news.data
trunk/htdocs/template.html

Modified: trunk/htdocs/news.data
===
--- trunk/htdocs/news.data  2008-04-28 10:09:16 UTC (rev 505)
+++ trunk/htdocs/news.data  2008-04-28 19:53:52 UTC (rev 506)
@@ -1,11 +1,213 @@
-
+
 
 
+
+  
+
+  
+   New RPy Documentation Wiki
+   2008-04-28
+  
+
+  
+  
+  
+
+
+   New RPy Documentation Wiki
+
 
+  
+   Thanks to hard work by John Reidel, the RPy manual has been converted 
into a Wiki.  
+   This should make it easer for everyone (especially end users) to 
contribute to 
+   the documentation.
+  
+
+  
+   Take a look at http://rpy.wiki.sf.net";>http://rpy.wiki.sf.net.
+  
+
+   
+ 
+
+
+
 
   
 
   
+   RPy 1.0.2 now available
+   2008-04-10
+  
+
+  
+  
+  
+
+
+  RPy 1.0.2 Released
+
+
+  
+   Hello RPy'ers:
+  
+
+  
+   I have just uploaded RPy version 1.0.2
+  
+
+  
+
+New features:
+
+- The 'Robj' type is now exported.
+
+- Add simple neural net example.
+
+Bug fixes:
+
+- Stack checking code was incorrectly disabled on all platforms,
+  corrected so that it is properly included for R 2.3.0 and later
+  everywhere except Win32.
+
+- Fixes for compatibility with Python 2.4 and later.
+
+- Updates to debian install files (Dirk Eddelbuettel)
+
+- Correct simple line plot example in the documentation
+
+- Minor internal changes to code and tests
+
+- Automatic build tool now uses 'tail -n 1' instead of 'tail -1' when
+  calling 'R RHOME' to make recent versions of tail happy
+
+- Add startup options to prevent initialization of console
+  read/write/showfiles which causes problems with R when run without a
+  controlling console. 
+
+Other changes:
+
+- Deletion of R's temporary directory now uses R's own internal function
+  for this task for R versions after 2.4.0.
+
+
+  
+
+   
+ 
+
+
+
+
+  
+
+  
+   RPy 1.0.1 now available
+   2007-11-29
+  
+
+  
+  
+  
+
+
+  RPy 1.0.0 Released
+
+
+  
+   Hello RPy'ers:
+  
+
+  
+   I have just uploaded RPy version 1.0.1.
+  
+
+  
+
+CHANGES IN RPY 1.0.1 - 2007-11-29
+-
+
+Bug Fixes:
+
+  - Correct silent termination on load on MS-Windows (really this time!)
+
+  - Improve detection of installed R versions during build process 
+on MS-Windows
+
+  
+
+   
+ 
+
+
+
+
+  
+
+  
+   RPy 1.0.0 now available
+   2007-11-15
+  
+
+  
+  
+  
+
+
+  RPy 1.0.0 Released
+
+
+  
+   Hello RPy'ers:
+  
+
+  
+   I have just uploaded RPy version 1.0.0
+  
+
+  
+
+New Features:
+
+  - Complete support for NumPy
+
+  - Add new exception types to provide better information on the
+source of the error:
+
+  RPyException: Base exception class for all RPy Exceptions
+
+  RPyTypeConversionException: Error in conversion between R
+  and Python
+
+  RPyRException Error raised within R
+
+  (RException is set equal to RPyException for backwards
+ compatibility)
+
+Bug Fixes:
+
+  - All Numeric and NumPy data types are either properly handled, or
+an appropriate exception is generated. 
+
+  - Properly handle unicode strings.
+
+  - Fix silent failure to start up on Win32 
+
+Other:
+
+  - Misc improvments to the test code.
+
+  
+
+   
+ 
+
+
+
+
+  
+
+  
RPy 1.0 RC 3 now available
2007-06-26
   

Modified: trunk/htdocs/template.html
===
--- trunk/htdocs/template.html  2008-04-28 10:09:16 UTC (rev 505)
+++ trunk/htdocs/template.html  2008-04-28 19:53:52 UTC (rev 506)
@@ -39,7 +39,7 @@
   
   
 About
-http://rpy.wiki.sourceforge.net/";>Wiki
+http://rpy.wiki.sourceforge.net/";>Wiki NEW!
 Bugs
 SVN
 Download
@@ -115,12 +115,39 @@
 News
 
   
+
   
+  New RPy Documentation Wiki
+ (2008-04-28) 
+  
+
+
+  
+  RPy 1.0.2 now available
+ (2008-04-10) 
+  
+
+  
+  RPy 1.0.1 now available
+ (2007-11-29) 
+  
+
+  
+  RPy 1.0.0 now available
+ (2007-11-15) 
+  
+
+  
   RPy 1.0 RC 3 now available
  (2007-06-26) 
   
 
   
+  RPy 1.0 RC 3 now available
+ (2007-06-26) 
+  
+
+  
   RPy 0.99.0 now available
  (2006-03-15) 
   


This was sent by the SourceFo

[Rpy] SF.net SVN: rpy: [507] trunk/htdocs/news.data

2008-04-28 Thread warnes
Revision: 507
  http://rpy.svn.sourceforge.net/rpy/?rev=507&view=rev
Author:   warnes
Date: 2008-04-28 12:58:14 -0700 (Mon, 28 Apr 2008)

Log Message:
---
Fix Wiki url on news page

Modified Paths:
--
trunk/htdocs/news.data

Modified: trunk/htdocs/news.data
===
--- trunk/htdocs/news.data  2008-04-28 19:53:52 UTC (rev 506)
+++ trunk/htdocs/news.data  2008-04-28 19:58:14 UTC (rev 507)
@@ -24,7 +24,7 @@
   
 
   
-   Take a look at http://rpy.wiki.sf.net";>http://rpy.wiki.sf.net.
+   Take a look at http://rpy.wiki.sourceforge.net/Manual+-+Top";>http://rpy.wiki.sourceforge.net/Manual+-+Top.
   
 

@@ -53,7 +53,7 @@
   
 
   
-   I have just uploaded RPy version 1.0.2
+   I have just uploaded RPy version 1.0.2cd 
   
 
   


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [510] trunk/rpy/src/rpymodule.c

2008-05-09 Thread warnes
Revision: 510
  http://rpy.svn.sourceforge.net/rpy/?rev=510&view=rev
Author:   warnes
Date: 2008-05-09 14:16:59 -0700 (Fri, 09 May 2008)

Log Message:
---
Patch to correct link problem with R-2.7.0

Modified Paths:
--
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2008-05-05 03:26:35 UTC (rev 509)
+++ trunk/rpy/src/rpymodule.c   2008-05-09 21:16:59 UTC (rev 510)
@@ -1778,7 +1778,11 @@
 R_dot_Last();   
 R_RunExitFinalizers();  
 CleanEd();  
+#if (R_VERSION >= R_Version(2,7,0))
+Rf_KillAllDevices();
+#else
 KillAllDevices();
+#endif
 
 #if (R_VERSION >= R_Version(2,4,0)) 
 R_CleanTempDir();


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [511] trunk/rpy/TODO

2008-05-09 Thread warnes
Revision: 511
  http://rpy.svn.sourceforge.net/rpy/?rev=511&view=rev
Author:   warnes
Date: 2008-05-09 14:17:54 -0700 (Fri, 09 May 2008)

Log Message:
---
Add to TODO.

Modified Paths:
--
trunk/rpy/TODO

Modified: trunk/rpy/TODO
===
--- trunk/rpy/TODO  2008-05-09 21:16:59 UTC (rev 510)
+++ trunk/rpy/TODO  2008-05-09 21:17:54 UTC (rev 511)
@@ -12,3 +12,7 @@
 U* More builtin classes for conversion of R classes
 
 I* More examples and a tutorial
+
+U* Modify setup.py for Mac OSX (darwin) to automagically set RHOMES and
+   appropriately modify (and then restore) the Current symlink durin
+   iteration of RHOMES 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [513] trunk/rpy/setup.py

2008-05-12 Thread warnes
Revision: 513
  http://rpy.svn.sourceforge.net/rpy/?rev=513&view=rev
Author:   warnes
Date: 2008-05-12 20:32:37 -0700 (Mon, 12 May 2008)

Log Message:
---
Add notes on what is necessary to build against multiple versions of R on OSX

Modified Paths:
--
trunk/rpy/setup.py

Modified: trunk/rpy/setup.py
===
--- trunk/rpy/setup.py  2008-05-10 13:30:40 UTC (rev 512)
+++ trunk/rpy/setup.py  2008-05-13 03:32:37 UTC (rev 513)
@@ -32,7 +32,7 @@
 
 DEBUG=True
 
-import os, os.path, sys, shutil
+import os, os.path, sys, shutil, re
 from distutils.core import setup, Extension
 from distutils.sysconfig import *
 from distutils.errors import *
@@ -66,6 +66,15 @@
 #if sys.platform=="win32":
 #rpy_wintools.CreatePythonWinLib()
 
+# On Mac OS X ("darwin") it is necessary to change the symlink
+#   /Library/Frameworks/R.framework/Versions/Current
+# to point to the current version of R in
+#  /Library/Frameworks/R.framework/Versions/X.Y
+# for that version of R to execute.  So, we need to store the original
+# symlink here so we can restore it when we are done
+if sys.platform=="darwin":
+  darwin_original_version = 
os.readlink("/Library/Frameworks/R.framework/Versions/Current")
+
 modules = []
 for RHOME in RHOMES:

@@ -87,6 +96,16 @@
 UNDEF = []
 
 # configure the R paths
+#if sys.platform=="darwin":
+#  version = 
+#  if os.symlink("/Library/Frameworks/R.framework/Versions/Current")
+#  if RHOME.endswith('/'):
+#RHOME = RHOME[:-1]
+#  print "RHOME=",os.path.join(os.path.dirname(RHOME),
+#  os.readlink(RHOME) )
+#  sys.exit()
+  
+
 RVERSION = rpy_tools.get_R_VERSION(RHOME, force_exec=True)
 RVER = rpy_tools.get_R_VERSION_CODE(RVERSION)
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [514] trunk/rpy

2008-05-12 Thread warnes
Revision: 514
  http://rpy.svn.sourceforge.net/rpy/?rev=514&view=rev
Author:   warnes
Date: 2008-05-12 20:47:51 -0700 (Mon, 12 May 2008)

Log Message:
---
Updated for 1.0.3

Modified Paths:
--
trunk/rpy/NEWS
trunk/rpy/rpy_version.py

Modified: trunk/rpy/NEWS
===
--- trunk/rpy/NEWS  2008-05-13 03:32:37 UTC (rev 513)
+++ trunk/rpy/NEWS  2008-05-13 03:47:51 UTC (rev 514)
@@ -1,3 +1,13 @@
+CHANGES IN RPY 1.0.3 - 2008-05-12
+-
+
+Bug fixes:
+
+- Correct issue with R 2.7.0. (R 2.7.0 exports the symbol 'Rf_KillAllDevices' 
+  instead of 'KillAllDevices')
+
+
+
 CHANGES IN RPY 1.0.2 - 2008-04-02
 -
 

Modified: trunk/rpy/rpy_version.py
===
--- trunk/rpy/rpy_version.py2008-05-13 03:32:37 UTC (rev 513)
+++ trunk/rpy/rpy_version.py2008-05-13 03:47:51 UTC (rev 514)
@@ -1 +1 @@
-rpy_version = "1.0.2"
+rpy_version = "1.0.3"


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [515] trunk/rpy/src

2008-05-14 Thread warnes
Revision: 515
  http://rpy.svn.sourceforge.net/rpy/?rev=515&view=rev
Author:   warnes
Date: 2008-05-14 06:53:05 -0700 (Wed, 14 May 2008)

Log Message:
---
Minor changes to remove compilation warnings

Modified Paths:
--
trunk/rpy/src/RPy.h
trunk/rpy/src/io.c
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/RPy.h
===
--- trunk/rpy/src/RPy.h 2008-05-13 03:47:51 UTC (rev 514)
+++ trunk/rpy/src/RPy.h 2008-05-14 13:53:05 UTC (rev 515)
@@ -52,6 +52,13 @@
 #include 
 #include 
 #include 
+
+#if (R_VERSION >= R_Version(2,4,0)) 
+#include 
+#endif
+
+
+
 #undef _POSIX_C_SOURCE
 #include 
 #include 

Modified: trunk/rpy/src/io.c
===
--- trunk/rpy/src/io.c  2008-05-13 03:47:51 UTC (rev 514)
+++ trunk/rpy/src/io.c  2008-05-14 13:53:05 UTC (rev 515)
@@ -130,7 +130,7 @@
 PyErr_Clear();
 return 0;
   }
-  snprintf(buf, len, "%s", PyString_AsString(input_data));
+  snprintf( (char*) buf, len, "%s", PyString_AsString(input_data));
   Py_DECREF(input_data);
   return 1;
 }

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2008-05-13 03:47:51 UTC (rev 514)
+++ trunk/rpy/src/rpymodule.c   2008-05-14 13:53:05 UTC (rev 515)
@@ -1772,8 +1772,10 @@
 
 void r_finalize(void)
 {
+#if (R_VERSION < R_Version(2,4,0)) 
 unsigned char buf[1024];
 char * tmpdir;
+#endif
 
 R_dot_Last();   
 R_RunExitFinalizers();  


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [516] trunk/rpy/TODO

2008-05-14 Thread warnes
Revision: 516
  http://rpy.svn.sourceforge.net/rpy/?rev=516&view=rev
Author:   warnes
Date: 2008-05-14 10:05:47 -0700 (Wed, 14 May 2008)

Log Message:
---
Add note about checking for Rlapack

Modified Paths:
--
trunk/rpy/TODO

Modified: trunk/rpy/TODO
===
--- trunk/rpy/TODO  2008-05-14 13:53:05 UTC (rev 515)
+++ trunk/rpy/TODO  2008-05-14 17:05:47 UTC (rev 516)
@@ -16,3 +16,6 @@
 U* Modify setup.py for Mac OSX (darwin) to automagically set RHOMES and
appropriately modify (and then restore) the Current symlink durin
iteration of RHOMES 
+
+I* Have setup.py check for the existence of Rlapack, and fall back to linking
+   to regular lapack if it is not present on *nix.


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [517] trunk/rpy/setup.py

2008-05-14 Thread warnes
Revision: 517
  http://rpy.svn.sourceforge.net/rpy/?rev=517&view=rev
Author:   warnes
Date: 2008-05-14 10:10:57 -0700 (Wed, 14 May 2008)

Log Message:
---
Turn off debug build flag for default installs, add todo about Rlapack/lapack

Modified Paths:
--
trunk/rpy/setup.py

Modified: trunk/rpy/setup.py
===
--- trunk/rpy/setup.py  2008-05-14 17:05:47 UTC (rev 516)
+++ trunk/rpy/setup.py  2008-05-14 17:10:57 UTC (rev 517)
@@ -30,13 +30,14 @@
 See the files INSTALL.UNIX and INSTALL.WINDOWS for more details.
 """
 
-DEBUG=True
+DEBUG=False
 
 import os, os.path, sys, shutil, re
 from distutils.core import setup, Extension
 from distutils.sysconfig import *
 from distutils.errors import *
 import rpy_tools
+
 if sys.platform=="win32":
 import rpy_wintools
 
@@ -85,7 +86,7 @@
 get_config_vars()['OPT'] = '-g -Wall'
 else:
 # to avoid strict prototypes errors from R includes
-get_config_vars()['OPT'] = '-DNDEBUG -g -O3 -Wall'
+get_config_vars()['OPT'] = '-DNDEBUG -O3 -Wall'
 
 # get the Python version
 if sys.version[:3] >= '2.2':
@@ -160,7 +161,10 @@
 else: # unix-like systems, this is known to work for Linux and Solaris
 include_dirs = [ os.path.join(RHOME.strip(), 'include'), 
  'src', '/usr/share/R/include' ]
+
+# TODO: determine if Rlapack is available, if not use standard lapack
 libraries=['R','Rlapack']
+
 library_dirs = r_libs
 runtime_libs = r_libs
 extra_compile_args=["-shared"]


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [523] trunk/rpy

2008-05-14 Thread warnes
Revision: 523
  http://rpy.svn.sourceforge.net/rpy/?rev=523&view=rev
Author:   warnes
Date: 2008-05-14 11:31:21 -0700 (Wed, 14 May 2008)

Log Message:
---
Use the 'R CMD config LAPACK_LIBS' command to determin the appropriate link 
flags for lapack, instead of blindly assuming that '-L/lib -lRlapack' is 
the correct magic incantation.

Modified Paths:
--
trunk/rpy/rpy_tools.py
trunk/rpy/setup.py

Modified: trunk/rpy/rpy_tools.py
===
--- trunk/rpy/rpy_tools.py  2008-05-14 17:51:40 UTC (rev 522)
+++ trunk/rpy/rpy_tools.py  2008-05-14 18:31:21 UTC (rev 523)
@@ -143,3 +143,20 @@
% PYTHON_DIR )
 
   return PYTHON_DIR
+
+def get_R_LAPACK_LIB_FLAGS(RHOME=get_R_HOME()):
+  """
+  Determine the necessary link arguments for lapack 
+  """
+  rexec = os.path.join(RHOME, 'bin', 'R')
+  stat, output = getstatusoutput('"%s" CMD config LAPACK_LIBS' % rexec )
+  if stat or len(output)<=0:
+raise RuntimeError("Couldn't execute the R interpreter" +
+   " `%s'.\n" % rexec )
+  
+  LAPACK_LIB_FLAGS = output.strip()
+  if not LAPACK_LIB_FLAGS:
+raise RuntimeError("Couldn't obtain LAPACK_LIBS information from output\n"
+   "of `R CMD config LAPACK_LIBS'.\n")
+  
+  return LAPACK_LIB_FLAGS

Modified: trunk/rpy/setup.py
===
--- trunk/rpy/setup.py  2008-05-14 17:51:40 UTC (rev 522)
+++ trunk/rpy/setup.py  2008-05-14 18:31:21 UTC (rev 523)
@@ -150,26 +150,22 @@
 library_dirs= r_libs
 runtime_libs = r_libs
 extra_compile_args=[]
-elif sys.platform=='osf1V5':
-include_dirs = [ os.path.join(RHOME.strip(), 'include'), 
- 'src' ]
-libraries=['R','Rlapack']
-library_dirs = r_libs
-runtime_libs = r_libs
-extra_compile_args=["-shared"]
-source_files = source_files + ["src/setenv.c"]
+
 else: # unix-like systems, this is known to work for Linux and Solaris
 include_dirs = [ os.path.join(RHOME.strip(), 'include'), 
  'src', '/usr/share/R/include' ]
 
-# TODO: determine if Rlapack is available, if not use standard lapack
-libraries=['R','Rlapack']
-
 library_dirs = r_libs
 runtime_libs = r_libs
 extra_compile_args=["-shared"]
 source_files = source_files + ["src/setenv.c"]
+
+libraries=['R']
+  
+# Ask R to tell us how to properly link against lapack
+extra_compile_args += [ rpy_tools.get_R_LAPACK_LIB_FLAGS( RHOME ) ]
 
+
 # Discover which array packages are present
 try: 
 import numpy


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [524] trunk/rpy/TODO

2008-05-14 Thread warnes
Revision: 524
  http://rpy.svn.sourceforge.net/rpy/?rev=524&view=rev
Author:   warnes
Date: 2008-05-14 11:33:26 -0700 (Wed, 14 May 2008)

Log Message:
---
remove completed TODO entry

Modified Paths:
--
trunk/rpy/TODO

Modified: trunk/rpy/TODO
===
--- trunk/rpy/TODO  2008-05-14 18:31:21 UTC (rev 523)
+++ trunk/rpy/TODO  2008-05-14 18:33:26 UTC (rev 524)
@@ -16,6 +16,3 @@
 U* Modify setup.py for Mac OSX (darwin) to automagically set RHOMES and
appropriately modify (and then restore) the Current symlink durin
iteration of RHOMES 
-
-I* Have setup.py check for the existence of Rlapack, and fall back to linking
-   to regular lapack if it is not present on *nix.


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy:[665] trunk/htdocs/svn.data

2008-10-28 Thread warnes
Revision: 665
  http://rpy.svn.sourceforge.net/rpy/?rev=665&view=rev
Author:   warnes
Date: 2008-10-28 19:16:27 + (Tue, 28 Oct 2008)

Log Message:
---
Correct link to SVN viewer

Modified Paths:
--
trunk/htdocs/svn.data

Modified: trunk/htdocs/svn.data
===
--- trunk/htdocs/svn.data   2008-10-28 19:06:30 UTC (rev 664)
+++ trunk/htdocs/svn.data   2008-10-28 19:16:27 UTC (rev 665)
@@ -7,7 +7,7 @@
 
   
 
-  http://svn.sourceforge.net/viewcvs.py/rpy/";>
+  http://rpy.svn.sourceforge.net/viewvc/rpy/";>
Subversion Viewer (ViewVC)
   
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy:[666] trunk/htdocs/template.html

2008-10-28 Thread warnes
Revision: 666
  http://rpy.svn.sourceforge.net/rpy/?rev=666&view=rev
Author:   warnes
Date: 2008-10-28 19:28:14 + (Tue, 28 Oct 2008)

Log Message:
---
Add Larent's change to the html page template (annoucing RPy2 2.0.0-a3)

Modified Paths:
--
trunk/htdocs/template.html

Modified: trunk/htdocs/template.html
===
--- trunk/htdocs/template.html  2008-10-28 19:16:27 UTC (rev 665)
+++ trunk/htdocs/template.html  2008-10-28 19:28:14 UTC (rev 666)
@@ -121,6 +121,12 @@
 
   
 
+
+  
+  Release 2.0.0alpha3 for rpy2
+ (2008-08-25) 
+  
+
   
   Release 2.0.0alpha2 for rpy2
  (2008-08-03) 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy:[776] trunk/rpy/rpy_tools.py

2010-02-11 Thread warnes
Revision: 776
  http://rpy.svn.sourceforge.net/rpy/?rev=776&view=rev
Author:   warnes
Date: 2010-02-11 20:53:49 + (Thu, 11 Feb 2010)

Log Message:
---
Modify version regexp to allow multi-digit numbers in any section.

Modified Paths:
--
trunk/rpy/rpy_tools.py

Modified: trunk/rpy/rpy_tools.py
===
--- trunk/rpy/rpy_tools.py  2010-02-06 18:27:21 UTC (rev 775)
+++ trunk/rpy/rpy_tools.py  2010-02-11 20:53:49 UTC (rev 776)
@@ -97,9 +97,7 @@
 if stat or len(output)<=0:
   raise RuntimeError("Couldn't execute the R interpreter" +
  " `%s'.\n" % rexec )
-# edd 05 Apr 2006  version = re.search("R +([0-9]\.[0-9]\.[0-9])", output)
-# edd 16 Oct 2009  version = re.search("R +([0-9]\.[0-9]+\.[0-9])", output)
-version = re.search(" +([0-9]\.[0-9]+\.[0-9])", output)
+version = re.search(" +([0-9]+\.[0-9]+\.[0-9]+)", output)
 if not version:
   raise RuntimeError("Couldn't obtain version number from output\n"
"of `R --version'.\n")


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [342] trunk/rpy

2007-02-20 Thread warnes
Revision: 342
  http://svn.sourceforge.net/rpy/?rev=342&view=rev
Author:   warnes
Date: 2007-02-20 08:41:47 -0800 (Tue, 20 Feb 2007)

Log Message:
---
Initial attempt to apply Numpy support patch provided by Alexander Belopolsky

Modified Paths:
--
trunk/rpy/rpy.py
trunk/rpy/setup.py
trunk/rpy/src/RPy.h
trunk/rpy/src/rpymodule.c
trunk/rpy/tests/test_array.py
trunk/rpy/tests/test_numeric.py
trunk/rpy/tests/test_topy.py

Modified: trunk/rpy/rpy.py
===
--- trunk/rpy/rpy.py2006-12-11 18:59:37 UTC (rev 341)
+++ trunk/rpy/rpy.py2007-02-20 16:41:47 UTC (rev 342)
@@ -32,12 +32,17 @@
 # installation time and RPy should have been compiled properly. So,
 # don't complain.
 try:
-from Numeric import *
-HAS_NUMERIC = 1
+from numpy import *
+HAS_NUMERIC = 3
 except ImportError:
-HAS_NUMERIC = 0
-pass
+try:
+from Numeric import *
+HAS_NUMERIC = 1
+except ImportError:
+HAS_NUMERIC = 0
+pass
 
+
 # Get necessary paths and version information
 RHOME=os.environ.get('RHOME',None)
 

Modified: trunk/rpy/setup.py
===
--- trunk/rpy/setup.py  2006-12-11 18:59:37 UTC (rev 341)
+++ trunk/rpy/setup.py  2007-02-20 16:41:47 UTC (rev 342)
@@ -137,12 +137,18 @@
 extra_compile_args=["-shared"]
 source_files = source_files + ["src/setenv.c"]
 
-# check whether Numeric is present
+# check whether NumPy is present
 try:
-import Numeric
-DEFINE.append(('WITH_NUMERIC', None))
+import numpy
+DEFINE.append(('WITH_NUMERIC', '3'))
+DEFINE.append(('PY_ARRAY_TYPES_PREFIX', 'PyArray_'))
+include_dirs.append(numpy.get_numpy_include())
 except ImportError:
-UNDEF.append('WITH_NUMERIC')
+# fall back to Numeric
+try:
+DEFINE.append(('WITH_NUMERIC', '1'))
+except ImportError:
+UNDEF.append('WITH_NUMERIC')
 
 # get the RPy version
 from rpy_version import rpy_version
@@ -154,13 +160,9 @@
 
 # use R version specific shared library name
 shlib_name = "_rpy%s" % RVER
-if sys.platform=="win32":
-DEFINE.append( ('RPY_SHNAME', '\\"_rpy%s\\"' % RVER ) )
-else:
-DEFINE.append( ('RPY_SHNAME', '"_rpy%s"' % RVER ) )
+DEFINE.append( ('RPY_SHNAME', shlib_name))
 DEFINE.append( ('INIT_RPY', 'init_rpy%s' % RVER ) )
 
-
 modules.append( Extension(
 shlib_name,
 source_files,

Modified: trunk/rpy/src/RPy.h
===
--- trunk/rpy/src/RPy.h 2006-12-11 18:59:37 UTC (rev 341)
+++ trunk/rpy/src/RPy.h 2007-02-20 16:41:47 UTC (rev 342)
@@ -87,12 +87,23 @@
 
 #include 
 
+#ifdef WITH_NUMERIC
+# if WITH_NUMERIC == 3
+#include "numpy/arrayobject.h"
+#define PY_ARRAY_MODULE_NAME "numpy"
+# elif WITH_NUMERIC == 1
+#include "Numeric/arrayobject.h"
+#define PY_ARRAY_MODULE_NAME "multiarray"
+# else
+#error "unknown array variant"
+# endif
+#endif
+#define xstr(s) str(s)
+#define str(s) #s
+
 #include "robjobject.h"
 #include "setenv.h"
 
-#ifdef WITH_NUMERIC
-#include "Numeric/arrayobject.h"
-#endif
 
 #define MAXIDSIZE 256
 

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2006-12-11 18:59:37 UTC (rev 341)
+++ trunk/rpy/src/rpymodule.c   2007-02-20 16:41:47 UTC (rev 342)
@@ -1556,7 +1556,7 @@
   if(use_numeric)
 {
   import_array();
-  multiarray = PyImport_ImportModule("multiarray");
+  multiarray = PyImport_ImportModule(PY_ARRAY_MODULE_NAME);
   if (multiarray) {
 dict = PyModule_GetDict(multiarray);
 if (dict)
@@ -1652,7 +1652,7 @@
   R_DefParams(Rp);
 
   /* set R_HOME */
-  Rp->rhome = RHOME;
+  Rp->rhome = xstr(RHOME);
 
   index = strlen(RUSER) - 1;
   
@@ -1733,7 +1733,7 @@
 #endif
 
   //m = Py_InitModule(MacroQuote(RPY_SHNAME), rpy_methods);
-  m = Py_InitModule(RPY_SHNAME, rpy_methods);
+  m = Py_InitModule(xstr(RPY_SHNAME), rpy_methods);
   d = PyModule_GetDict(m);
 
   /* Save this interpreter */

Modified: trunk/rpy/tests/test_array.py
===
--- trunk/rpy/tests/test_array.py   2006-12-11 18:59:37 UTC (rev 341)
+++ trunk/rpy/tests/test_array.py   2007-02-20 16:41:47 UTC (rev 342)
@@ -28,7 +28,7 @@
 r.array.autoconvert(BASIC_CONVERSION)
 
 def testConversionToPy(self):
-self.failUnless(self.p

[Rpy] SF.net SVN: rpy: [343] trunk/rpy/src/rpymodule.c

2007-03-12 Thread warnes
Revision: 343
  http://svn.sourceforge.net/rpy/?rev=343&view=rev
Author:   warnes
Date: 2007-03-12 15:50:59 -0700 (Mon, 12 Mar 2007)

Log Message:
---
Applied patch created by Andrew McNamara that resolves the C stack limit error 
produced by R in some contexts, such as resizing the x11() window.

Modified Paths:
--
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2007-02-20 16:41:47 UTC (rev 342)
+++ trunk/rpy/src/rpymodule.c   2007-03-12 22:50:59 UTC (rev 343)
@@ -39,6 +39,7 @@
  *
  * * END LICENSE BLOCK * */
 
+#define CSTACK_DEFNS
 #include "RPy.h"
 
 #define NONAMELESSUNION
@@ -1755,6 +1756,7 @@
   Rf_initEmbeddedR( sizeof(defaultargv) / sizeof(defaultargv[0]),
 defaultargv);
 #endif
+  R_CStackLimit = (uintptr_t)-1;
 
   /* Restore Python handlers */
   PyOS_setsig(SIGINT, old_int);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [344] trunk/rpy/src/rpymodule.c

2007-03-24 Thread warnes
Revision: 344
  http://svn.sourceforge.net/rpy/?rev=344&view=rev
Author:   warnes
Date: 2007-03-24 14:40:01 -0700 (Sat, 24 Mar 2007)

Log Message:
---
R_CStackLimit is only present on Unix-like systems, so omit it on Win32.

Modified Paths:
--
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2007-03-12 22:50:59 UTC (rev 343)
+++ trunk/rpy/src/rpymodule.c   2007-03-24 21:40:01 UTC (rev 344)
@@ -1756,8 +1756,14 @@
   Rf_initEmbeddedR( sizeof(defaultargv) / sizeof(defaultargv[0]),
 defaultargv);
 #endif
-  R_CStackLimit = (uintptr_t)-1;
 
+
+#ifndef _WIN32
+  /* Disable C stack checking, which is incompatible with use as a
+ shared library. */
+  R_CStackLimit = (uintptr_t)-1; 
+#endif
+
   /* Restore Python handlers */
   PyOS_setsig(SIGINT, old_int);
 #ifndef _WIN32


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [345] trunk/htdocs

2007-04-06 Thread warnes
Revision: 345
  http://svn.sourceforge.net/rpy/?rev=345&view=rev
Author:   warnes
Date: 2007-04-06 09:51:18 -0700 (Fri, 06 Apr 2007)

Log Message:
---
Add Tim Churches RPy demo and update link

Modified Paths:
--
trunk/htdocs/documentation.data
trunk/htdocs/index.data
trunk/htdocs/index.html

Added Paths:
---
trunk/htdocs/demo/
trunk/htdocs/demo/faithful_ecdf.png
trunk/htdocs/demo/faithful_histogram.png
trunk/htdocs/demo/faithful_qq.png
trunk/htdocs/demo/rpy_demo.html

Added: trunk/htdocs/demo/faithful_ecdf.png
===
(Binary files differ)


Property changes on: trunk/htdocs/demo/faithful_ecdf.png
___
Name: svn:mime-type
   + application/octet-stream

Added: trunk/htdocs/demo/faithful_histogram.png
===
(Binary files differ)


Property changes on: trunk/htdocs/demo/faithful_histogram.png
___
Name: svn:mime-type
   + application/octet-stream

Added: trunk/htdocs/demo/faithful_qq.png
===
(Binary files differ)


Property changes on: trunk/htdocs/demo/faithful_qq.png
___
Name: svn:mime-type
   + application/octet-stream

Added: trunk/htdocs/demo/rpy_demo.html
===
--- trunk/htdocs/demo/rpy_demo.html (rev 0)
+++ trunk/htdocs/demo/rpy_demo.html 2007-04-06 16:51:18 UTC (rev 345)
@@ -0,0 +1,214 @@
+
+
+http://gestalt-system.sourceforge.net/rpy_demo.html";>
+
+A demonstration of RPy
+
+
+http://rpy.sourceforge.net/";>RPy, written by Walter 
Moreira, is a Python extension module for using the 
+http://www.r-project.org";>R programming environment for data analysis 
and graphics from within http://www.python.org";>Python.
+http://rpy.sourceforge.net/";>RPy is available from the 
http://rpy.sourceforge.net/";>RPy project web page.
+As Walter notes, RPy was inspired by http://www.omegahat.org/RSPython/index.html";>RSPython by Duncan 
Temple Lang. RSPython
+allows R to be called from Python and vice-versa (i.e. Python can be 
embedded in R), as well as providing more general facilities for 
+exploiting the object-oriented aspects of both Python and R. However, at least 
for me, RPy is a lot easier to use. It is my sincere hope that
+RPy and RSPython can be merged in a display of el Norte/el Sur co-operation, 
so we can have the best of both.  
+
+The following example provides a small taste of both the power of the R 
environment and the ease with which RPy allows this power to be used from 
within Python.
+The data are eruption times for the Old Faithful geyser which, along with 
Yogi Bear, is located in the Yellowstone National Park in Wyoming, USA.
+The data file faithful.dat was exported from the 
faithful example dataset which comes as part of R. The R code in this
+example was borrowed directly from Section 8.2 of "http://cran.r-project.org/manuals.html";>An Introduction to R, Version 
1.4.1" by W.N. Venables, D.M. Smith and the R Development Core Team.
+Minimal changes to the orginal R code were required to make it work from 
within Python, thanks to RPy.
+
+The following Python code (faithful.py):
+
+
+
+
+from rpy import *
+
+faithful_data = {"eruption_duration":[],
+ "waiting_time":[]}
+
+f = open('faithful.dat','r')
+
+for row in f.readlines()[1:]: # skip the column header line
+splitrow = row[:-1].split(" ")
+faithful_data["eruption_duration"].append(float(splitrow[0]))
+faithful_data["waiting_time"].append(int(splitrow[1]))
+
+f.close()
+
+ed = faithful_data["eruption_duration"] 
+edsummary = r.summary(ed)
+print "Summary of Old Faithful eruption duration data"
+for k in edsummary.keys():
+print k + ": %.3f" % edsummary[k]
+print
+print "Stem-and-leaf plot of Old Faithful eruption duration data"
+print r.stem(ed)
+
+r.png('faithful_histogram.png',width=733,height=550)
+r.hist(ed,r.seq(1.6, 5.2, 0.2), prob=1,col="lightgreen",main="Old Faithful 
eruptions",xlab="Eruption duration (seconds)")
+r.lines(r.density(ed,bw=0.1),col="orange")
+r.rug(ed)
+r.dev_off()
+
+long_ed = filter(lambda x: x > 3, ed)
+r.png('faithful_ecdf.png',width=733,height=550)
+r.library('stepfun')
+r.plot(r.ecdf(long_ed), do_points=0, verticals=1, col="blue",main="Empirical 
cumulative distribution function of Old Faithful eruptions longer than 3 
seconds")
+x = 

[Rpy] SF.net SVN: rpy: [346] trunk/htdocs

2007-04-06 Thread warnes
Revision: 346
  http://svn.sourceforge.net/rpy/?rev=346&view=rev
Author:   warnes
Date: 2007-04-06 10:09:59 -0700 (Fri, 06 Apr 2007)

Log Message:
---
Intergrate demo into site

Modified Paths:
--
trunk/htdocs/Makefile
trunk/htdocs/documentation.data
trunk/htdocs/index.data
trunk/htdocs/index.html
trunk/htdocs/plotting-with-RPy.html
trunk/htdocs/template.html

Added Paths:
---
trunk/htdocs/rpy_demo.data

Removed Paths:
-
trunk/htdocs/demo/rpy_demo.html

Modified: trunk/htdocs/Makefile
===
--- trunk/htdocs/Makefile   2007-04-06 16:51:18 UTC (rev 345)
+++ trunk/htdocs/Makefile   2007-04-06 17:09:59 UTC (rev 346)
@@ -2,7 +2,7 @@
 
 SRC = news.data  documentation.data  download.data \
   faq.data  index.data  todo.data bugs.data maillist.data \
-  svn.data plotting-with-RPy.data
+  svn.data plotting-with-RPy.data rpy_demo.data
 
 TARGETS = $(addsuffix .html,$(basename $(SRC)))
 

Deleted: trunk/htdocs/demo/rpy_demo.html
===
--- trunk/htdocs/demo/rpy_demo.html 2007-04-06 16:51:18 UTC (rev 345)
+++ trunk/htdocs/demo/rpy_demo.html 2007-04-06 17:09:59 UTC (rev 346)
@@ -1,214 +0,0 @@
-
-
-http://gestalt-system.sourceforge.net/rpy_demo.html";>
-
-A demonstration of RPy
-
-
-http://rpy.sourceforge.net/";>RPy, written by Walter 
Moreira, is a Python extension module for using the 
-http://www.r-project.org";>R programming environment for data analysis 
and graphics from within http://www.python.org";>Python.
-http://rpy.sourceforge.net/";>RPy is available from the 
http://rpy.sourceforge.net/";>RPy project web page.
-As Walter notes, RPy was inspired by http://www.omegahat.org/RSPython/index.html";>RSPython by Duncan 
Temple Lang. RSPython
-allows R to be called from Python and vice-versa (i.e. Python can be 
embedded in R), as well as providing more general facilities for 
-exploiting the object-oriented aspects of both Python and R. However, at least 
for me, RPy is a lot easier to use. It is my sincere hope that
-RPy and RSPython can be merged in a display of el Norte/el Sur co-operation, 
so we can have the best of both.  
-
-The following example provides a small taste of both the power of the R 
environment and the ease with which RPy allows this power to be used from 
within Python.
-The data are eruption times for the Old Faithful geyser which, along with 
Yogi Bear, is located in the Yellowstone National Park in Wyoming, USA.
-The data file faithful.dat was exported from the 
faithful example dataset which comes as part of R. The R code in this
-example was borrowed directly from Section 8.2 of "http://cran.r-project.org/manuals.html";>An Introduction to R, Version 
1.4.1" by W.N. Venables, D.M. Smith and the R Development Core Team.
-Minimal changes to the orginal R code were required to make it work from 
within Python, thanks to RPy.
-
-The following Python code (faithful.py):
-
-
-
-
-from rpy import *
-
-faithful_data = {"eruption_duration":[],
- "waiting_time":[]}
-
-f = open('faithful.dat','r')
-
-for row in f.readlines()[1:]: # skip the column header line
-splitrow = row[:-1].split(" ")
-faithful_data["eruption_duration"].append(float(splitrow[0]))
-faithful_data["waiting_time"].append(int(splitrow[1]))
-
-f.close()
-
-ed = faithful_data["eruption_duration"] 
-edsummary = r.summary(ed)
-print "Summary of Old Faithful eruption duration data"
-for k in edsummary.keys():
-print k + ": %.3f" % edsummary[k]
-print
-print "Stem-and-leaf plot of Old Faithful eruption duration data"
-print r.stem(ed)
-
-r.png('faithful_histogram.png',width=733,height=550)
-r.hist(ed,r.seq(1.6, 5.2, 0.2), prob=1,col="lightgreen",main="Old Faithful 
eruptions",xlab="Eruption duration (seconds)")
-r.lines(r.density(ed,bw=0.1),col="orange")
-r.rug(ed)
-r.dev_off()
-
-long_ed = filter(lambda x: x > 3, ed)
-r.png('faithful_ecdf.png',width=733,height=550)
-r.library('stepfun')
-r.plot(r.ecdf(long_ed), do_points=0, verticals=1, col="blue",main="Empirical 
cumulative distribution function of Old Faithful eruptions longer than 3 
seconds")
-x = r.seq(3,5.4,0.01)
-r.lines(r.seq(3,5.4,0.01),r.pnorm(r.seq(3,5.4,0.01),mean=r.mean(long_ed), 
sd=r.sqrt(r.var(long_ed))), lty=3, lwd=2, col="red")
-r.dev_off()
-
-r.png('faithful_qq.png',width=733,height=550)
-r.par(pty="s")
-r.qqnorm(long_ed,col="blue")
-r.qqline(long_ed,col="red")
-r.dev_off()
-
-r.library('ctest')
-print
-print "Shapiro-Wilks normality test of Old

[Rpy] SF.net SVN: rpy: [347] trunk/htdocs

2007-04-06 Thread warnes
Revision: 347
  http://svn.sourceforge.net/rpy/?rev=347&view=rev
Author:   warnes
Date: 2007-04-06 10:18:13 -0700 (Fri, 06 Apr 2007)

Log Message:
---
Fix Walter's Home Page

Modified Paths:
--
trunk/htdocs/index.data

Removed Paths:
-
trunk/htdocs/about.data
trunk/htdocs/index.html

Deleted: trunk/htdocs/about.data
===
--- trunk/htdocs/about.data 2007-04-06 17:09:59 UTC (rev 346)
+++ trunk/htdocs/about.data 2007-04-06 17:18:13 UTC (rev 347)
@@ -1,109 +0,0 @@
-
-
-
-  
-RPy is a very simple, yet robust, http://www.python.org";>Python interface to the http://www.r-project.org";>R Programming Language.  It can
-manage all kinds of R objects and can execute arbitrary R functions
-(including the graphic functions).  All the errors from the R language
-are converted to Python exceptions.  Any module that later were
-installed on the R system, can easily be used from within Python,
-without introducing any changes.
-  
-
-  
-This code is inspired in http://www.omegahat.org/RSPython";>RSPython from the http://www.omegahat.org";>Omegahat project. The main goals of
-RPy are:
-  
-
-  
-
- to have a very robust interface for using
-  R from Python
-
-
- the interface should be as transparent and easy to use as
-  possible
-
-
- it should be usable for real scientific and statistical
-  computations
-
-
-  
-
-  Call for contributions
-
-  
-I appreciate all your feedback. If you have use RPy on a real
-world project or if you have an interesting example or demo,
-please, drop me a line. I'd like to collect some info, in this
-pages, about real examples, to show the Python and R joint
-capabilities. I hope that it will motivate many people in the
-scientific and statistics world to use Python.
-  
-
-  
-
-Contact info
-
-
-  
-Before contacting the authors, please try the 
-Rpy-talk Mailing List.  (We do have
-day jobs!)
-  
-
-
-
-
-  
-   
-  
-
-  
-   
- 
-   
-
-   
- Walter Moreira.
- 
-   Personal page: http://www.cmat.edu.uy/~walterm";>www.cmat.edu.uy/~walterm
- 
-
-   Email: 
-   mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]
-
- 
- 
- Last revision: January 16, 2004
-   
-  
-
-  
-   
- 
-   
-
-   
- Gregory R. Warnes
- 
-   Personal page: http://www.warnes.net";>www.warnes.net
- 
-
-   Email: 
- mailto:[EMAIL PROTECTED]">
-   [EMAIL PROTECTED]
- 
-
- 
- 
- Last revision: $Date$
-   
-  
-

Modified: trunk/htdocs/index.data
===
--- trunk/htdocs/index.data 2007-04-06 17:09:59 UTC (rev 346)
+++ trunk/htdocs/index.data 2007-04-06 17:18:13 UTC (rev 347)
@@ -77,8 +77,10 @@

Walter Moreira.

-   Personal page: http://www.cmat.edu.uy/~walterm";>www.cmat.edu.uy/~walterm
+   Personal page: 
+http://www.math.tamu.edu/~wmoreira/";>
+  http://www.math.tamu.edu/~wmoreira/ 
+

 


Deleted: trunk/htdocs/index.html
===
--- trunk/htdocs/index.html 2007-04-06 17:09:59 UTC (rev 346)
+++ trunk/htdocs/index.html 2007-04-06 17:18:13 UTC (rev 347)
@@ -1,354 +0,0 @@
-http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
-
-  
-RPy home page 
-
-  
-  
-
-
-
-  
-   
-
- 
- 
-
-  
-   
-  
-
- 
-
- 
-
-
- 
- 
-
-
- 
-   Sections
-  
-
-   
- 
-   
- 
-   
- About
-   
- 
- 
-   
- Bugs
-   
- 
- 
- SVN
-   
- 
- 
-   
- Download
-   
- 
- 
-   
- Documentation
-   
- 
- 
-   
- Demo
-   
- 
- 
-   
- FAQ
-

[Rpy] SF.net SVN: rpy: [348] trunk/htdocs/maillist.data

2007-04-06 Thread warnes
Revision: 348
  http://svn.sourceforge.net/rpy/?rev=348&view=rev
Author:   warnes
Date: 2007-04-06 10:31:18 -0700 (Fri, 06 Apr 2007)

Log Message:
---
Fix broken link to mailing list archives

Modified Paths:
--
trunk/htdocs/maillist.data

Modified: trunk/htdocs/maillist.data
===
--- trunk/htdocs/maillist.data  2007-04-06 17:18:13 UTC (rev 347)
+++ trunk/htdocs/maillist.data  2007-04-06 17:31:18 UTC (rev 348)
@@ -8,13 +8,13 @@
 
   
 
-  http://lists.sourceforge.net/lists/listinfo/rpy-list";>
+  https://lists.sourceforge.net/lists/listinfo/rpy-list";>
Subscribe/Unsubscribe/Preferences
   
 
 
 
-  http://sourceforge.net/mailarchive/forum.php?forum=rpy-list";>
+  http://sourceforge.net/mailarchive/forum.php?forum_name=rpy-list";>
List Archives
   
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [349] trunk/htdocs/faithful.dat

2007-04-16 Thread warnes
Revision: 349
  http://svn.sourceforge.net/rpy/?rev=349&view=rev
Author:   warnes
Date: 2007-04-16 09:13:16 -0700 (Mon, 16 Apr 2007)

Log Message:
---
Add faithful.dat data file

Added Paths:
---
trunk/htdocs/faithful.dat

Added: trunk/htdocs/faithful.dat
===
--- trunk/htdocs/faithful.dat   (rev 0)
+++ trunk/htdocs/faithful.dat   2007-04-16 16:13:16 UTC (rev 349)
@@ -0,0 +1,273 @@
+"eruptions" "waiting"
+3.6 79
+1.8 54
+3.333 74
+2.283 62
+4.533 85
+2.883 55
+4.7 88
+3.6 85
+1.95 51
+4.35 85
+1.833 54
+3.917 84
+4.2 78
+1.75 47
+4.7 83
+2.167 52
+1.75 62
+4.8 84
+1.6 52
+4.25 79
+1.8 51
+1.75 47
+3.45 78
+3.067 69
+4.533 74
+3.6 83
+1.967 55
+4.083 76
+3.85 78
+4.433 79
+4.3 73
+4.467 77
+3.367 66
+4.033 80
+3.833 74
+2.017 52
+1.867 48
+4.833 80
+1.833 59
+4.783 90
+4.35 80
+1.883 58
+4.567 84
+1.75 58
+4.533 73
+3.317 83
+3.833 64
+2.1 53
+4.633 82
+2 59
+4.8 75
+4.716 90
+1.833 54
+4.833 80
+1.733 54
+4.883 83
+3.717 71
+1.667 64
+4.567 77
+4.317 81
+2.233 59
+4.5 84
+1.75 48
+4.8 82
+1.817 60
+4.4 92
+4.167 78
+4.7 78
+2.067 65
+4.7 73
+4.033 82
+1.967 56
+4.5 79
+4 71
+1.983 62
+5.067 76
+2.017 60
+4.567 78
+3.883 76
+3.6 83
+4.133 75
+4.333 82
+4.1 70
+2.633 65
+4.067 73
+4.933 88
+3.95 76
+4.517 80
+2.167 48
+4 86
+2.2 60
+4.333 90
+1.867 50
+4.817 78
+1.833 63
+4.3 72
+4.667 84
+3.75 75
+1.867 51
+4.9 82
+2.483 62
+4.367 88
+2.1 49
+4.5 83
+4.05 81
+1.867 47
+4.7 84
+1.783 52
+4.85 86
+3.683 81
+4.733 75
+2.3 59
+4.9 89
+4.417 79
+1.7 59
+4.633 81
+2.317 50
+4.6 85
+1.817 59
+4.417 87
+2.617 53
+4.067 69
+4.25 77
+1.967 56
+4.6 88
+3.767 81
+1.917 45
+4.5 82
+2.267 55
+4.65 90
+1.867 45
+4.167 83
+2.8 56
+4.333 89
+1.833 46
+4.383 82
+1.883 51
+4.933 86
+2.033 53
+3.733 79
+4.233 81
+2.233 60
+4.533 82
+4.817 77
+4.333 76
+1.983 59
+4.633 80
+2.017 49
+5.1 96
+1.8 53
+5.033 77
+4 77
+2.4 65
+4.6 81
+3.567 71
+4 70
+4.5 81
+4.083 93
+1.8 53
+3.967 89
+2.2 45
+4.15 86
+2 58
+3.833 78
+3.5 66
+4.583 76
+2.367 63
+5 88
+1.933 52
+4.617 93
+1.917 49
+2.083 57
+4.583 77
+3.333 68
+4.167 81
+4.333 81
+4.5 73
+2.417 50
+4 85
+4.167 74
+1.883 55
+4.583 77
+4.25 83
+3.767 83
+2.033 51
+4.433 78
+4.083 84
+1.833 46
+4.417 83
+2.183 55
+4.8 81
+1.833 57
+4.8 76
+4.1 84
+3.966 77
+4.233 81
+3.5 87
+4.366 77
+2.25 51
+4.667 78
+2.1 60
+4.35 82
+4.133 91
+1.867 53
+4.6 78
+1.783 46
+4.367 77
+3.85 84
+1.933 49
+4.5 83
+2.383 71
+4.7 80
+1.867 49
+3.833 75
+3.417 64
+4.233 76
+2.4 53
+4.8 94
+2 55
+4.15 76
+1.867 50
+4.267 82
+1.75 54
+4.483 75
+4 78
+4.117 79
+4.083 78
+4.267 78
+3.917 70
+4.55 79
+4.083 70
+2.417 54
+4.183 86
+2.217 50
+4.45 90
+1.883 54
+1.85 54
+4.283 77
+3.95 79
+2.333 64
+4.15 75
+2.35 47
+4.933 86
+2.9 63
+4.583 85
+3.833 82
+2.083 57
+4.367 82
+2.133 67
+4.35 74
+2.2 54
+4.45 83
+3.567 73
+4.5 73
+4.15 88
+3.817 80
+3.917 71
+4.45 83
+2 56
+4.283 79
+4.767 78
+4.533 84
+1.85 58
+4.25 83
+1.983 43
+2.25 60
+4.75 75
+4.117 81
+2.15 46
+4.417 90
+1.817 46
+4.467 74


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [350] trunk/htdocs/faithful.py

2007-04-16 Thread warnes
Revision: 350
  http://svn.sourceforge.net/rpy/?rev=350&view=rev
Author:   warnes
Date: 2007-04-16 09:14:39 -0700 (Mon, 16 Apr 2007)

Log Message:
---
Add faithful.py to svn

Added Paths:
---
trunk/htdocs/faithful.py

Added: trunk/htdocs/faithful.py
===
--- trunk/htdocs/faithful.py(rev 0)
+++ trunk/htdocs/faithful.py2007-04-16 16:14:39 UTC (rev 350)
@@ -0,0 +1,60 @@
+from rpy import *
+
+faithful_data = {"eruption_duration":[],
+ "waiting_time":[]}
+
+f = open('faithful.dat','r')
+
+for row in f.readlines()[1:]: # skip the column header line
+splitrow = row[:-1].split(" ")
+faithful_data["eruption_duration"].append(float(splitrow[0]))
+faithful_data["waiting_time"].append(int(splitrow[1]))
+
+f.close()
+
+ed = faithful_data["eruption_duration"] 
+edsummary = r.summary(ed)
+print "Summary of Old Faithful eruption duration data"
+for k in edsummary.keys():
+print k + ": %.3f" % edsummary[k]
+print
+print "Stem-and-leaf plot of Old Faithful eruption duration data"
+print r.stem(ed)
+
+r.png('faithful_histogram.png',width=733,height=550)
+r.hist(ed,r.seq(1.6, 5.2, 0.2), prob=1,col="lightgreen",
+   main="Old Faithful eruptions",xlab="Eruption duration (seconds)")
+r.lines(r.density(ed,bw=0.1),col="orange")
+r.rug(ed)
+r.dev_off()
+
+long_ed = filter(lambda x: x > 3, ed)
+r.png('faithful_ecdf.png',width=733,height=550)
+r.library('stepfun')
+r.plot(r.ecdf(long_ed), do_points=0, verticals=1, col="blue",
+   main="Empirical cumulative distribution function of Old Faithful 
eruptions longer than 3 seconds")
+x = r.seq(3,5.4,0.01)
+r.lines(r.seq(3,5.4,0.01),r.pnorm(r.seq(3,5.4,0.01),mean=r.mean(long_ed), 
+sd=r.sqrt(r.var(long_ed))), lty=3, lwd=2, col="red")
+r.dev_off()
+
+r.png('faithful_qq.png',width=733,height=550)
+r.par(pty="s")
+r.qqnorm(long_ed,col="blue")
+r.qqline(long_ed,col="red")
+r.dev_off()
+
+r.library('ctest')
+print
+print "Shapiro-Wilks normality test of Old Faithful eruptions longer than 3 
seconds"
+sw = r.shapiro_test(long_ed)
+print "W = %.4f" % sw['statistic']['W']
+print "p-value = %.5f" % sw['p.value']
+
+print
+print "One-sample Kolmogorov-Smirnov test of Old Faithful eruptions longer 
than 3 seconds"
+ks = r.ks_test(long_ed,"pnorm", mean=r.mean(long_ed), 
sd=r.sqrt(r.var(long_ed)))
+print "D = %.4f" % ks['statistic']['D']
+print "p-value = %.4f" % ks['p.value']
+print "Alternative hypothesis: %s" % ks['alternative']
+print


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [351] trunk/rpy/rpy_version.py

2007-05-18 Thread warnes
Revision: 351
  http://svn.sourceforge.net/rpy/?rev=351&view=rev
Author:   warnes
Date: 2007-05-18 08:41:41 -0700 (Fri, 18 May 2007)

Log Message:
---
Update version number

Modified Paths:
--
trunk/rpy/rpy_version.py

Modified: trunk/rpy/rpy_version.py
===
--- trunk/rpy/rpy_version.py2007-04-16 16:14:39 UTC (rev 350)
+++ trunk/rpy/rpy_version.py2007-05-18 15:41:41 UTC (rev 351)
@@ -1 +1 @@
-rpy_version = "1.0-RC2"
+rpy_version = "1.0-RC3"


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [352] trunk/htdocs

2007-06-26 Thread warnes
Revision: 352
  http://svn.sourceforge.net/rpy/?rev=352&view=rev
Author:   warnes
Date: 2007-06-26 07:52:49 -0700 (Tue, 26 Jun 2007)

Log Message:
---
Update web pages for RC3

Modified Paths:
--
trunk/htdocs/news.data
trunk/htdocs/plotting-with-RPy.html
trunk/htdocs/template.html

Modified: trunk/htdocs/news.data
===
--- trunk/htdocs/news.data  2007-05-18 15:41:41 UTC (rev 351)
+++ trunk/htdocs/news.data  2007-06-26 14:52:49 UTC (rev 352)
@@ -1,6 +1,7 @@
 
 
 
+
 
   
 
@@ -14,6 +15,49 @@
   
 
 
+  RPy 1.0 RC 3 Released
+
+
+  
+   Hello RPy'ers:
+  
+
+  
+   I have just uploaded RPy version 1.0 RC 3.  Hopefully this
+will be the last release candidate before 1.0. 
+  
+
+  
+   This release fixes several bugs, particular those related to
+   new versions of R, including the infamous "C stack limit
+   error" which occured on *nix systems in some contexts, such as
+   resizing X11 windows.  This release should work properly
+   with R versions through 2.5.0.
+  
+
+  
+   RC3 also introduces support for NumPy.
+  
+
+   
+ 
+
+
+
+
+
+  
+
+  
+   RPy 0.4.6 now available
+   2005-07-28
+  
+
+  
+  
+  
+
+
   RPy 0.99.0 Released
 
 

Modified: trunk/htdocs/plotting-with-RPy.html
===
--- trunk/htdocs/plotting-with-RPy.html 2007-05-18 15:41:41 UTC (rev 351)
+++ trunk/htdocs/plotting-with-RPy.html 2007-06-26 14:52:49 UTC (rev 352)
@@ -307,11 +307,20 @@
 

  
+   RPy 1.0 RC 3 now available
+ (2007-06-26) 
+ 
+   
+
+
+   
+ 
RPy 0.99.0 now available
  (2006-03-15) 
  

 
+

  
RPy now using Subversion

Modified: trunk/htdocs/template.html
===
--- trunk/htdocs/template.html  2007-05-18 15:41:41 UTC (rev 351)
+++ trunk/htdocs/template.html  2007-06-26 14:52:49 UTC (rev 352)
@@ -188,11 +188,20 @@
 

  
+   RPy 1.0 RC 3 now available
+ (2007-06-26) 
+ 
+   
+
+
+   
+ 
RPy 0.99.0 now available
  (2006-03-15) 
  

 
+

  
RPy now using Subversion


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [353] trunk/rpy/tests/testall.py

2007-10-08 Thread warnes
Revision: 353
  http://rpy.svn.sourceforge.net/rpy/?rev=353&view=rev
Author:   warnes
Date: 2007-10-08 12:09:24 -0700 (Mon, 08 Oct 2007)

Log Message:
---
Show modules to be tested

Modified Paths:
--
trunk/rpy/tests/testall.py

Modified: trunk/rpy/tests/testall.py
===
--- trunk/rpy/tests/testall.py  2007-06-26 14:52:49 UTC (rev 352)
+++ trunk/rpy/tests/testall.py  2007-10-08 19:09:24 UTC (rev 353)
@@ -22,6 +22,8 @@
 modules = filter( lambda x: not x.endswith('.pyc'), modules)
 modules = filter( lambda x: x.startswith('test_'), modules)
 modules = filter( lambda x: x.endswith('.py'), modules)
+
+print "Modules to be tested:", modules
 
 for module in modules:
 print 'Testing:', module[5:-3]


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [354] trunk/rpy/src/rpymodule.c

2007-10-08 Thread warnes
Revision: 354
  http://rpy.svn.sourceforge.net/rpy/?rev=354&view=rev
Author:   warnes
Date: 2007-10-08 13:26:20 -0700 (Mon, 08 Oct 2007)

Log Message:
---
Use proper test for whether R_CStackLimit can/should be set

Modified Paths:
--
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2007-10-08 19:09:24 UTC (rev 353)
+++ trunk/rpy/src/rpymodule.c   2007-10-08 20:26:20 UTC (rev 354)
@@ -1758,7 +1758,7 @@
 #endif
 
 
-#ifndef _WIN32
+#ifndef CSTACK_DEFNS
   /* Disable C stack checking, which is incompatible with use as a
  shared library. */
   R_CStackLimit = (uintptr_t)-1; 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [355] trunk/rpy/rpy_options.py

2007-10-08 Thread warnes
Revision: 355
  http://rpy.svn.sourceforge.net/rpy/?rev=355&view=rev
Author:   warnes
Date: 2007-10-08 13:33:53 -0700 (Mon, 08 Oct 2007)

Log Message:
---
Change default for rpy_options.VERBOSE to False

Modified Paths:
--
trunk/rpy/rpy_options.py

Modified: trunk/rpy/rpy_options.py
===
--- trunk/rpy/rpy_options.py2007-10-08 20:26:20 UTC (rev 354)
+++ trunk/rpy/rpy_options.py2007-10-08 20:33:53 UTC (rev 355)
@@ -28,7 +28,7 @@
   'RVER':None,# R Version *number*
   'RUSER':None,   # R User's Home Directory
   'USE_NUMERIC':None, # Is Numeric module available
-  'VERBOSE':True  # Should status messages be displated.
+  'VERBOSE':False  # Should status messages be displated.
   }
 
 def set_options(RHOME=None, USE_NUMERIC=None, VERBOSE=None):


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [356] trunk/rpy/setup.py

2007-10-08 Thread warnes
Revision: 356
  http://rpy.svn.sourceforge.net/rpy/?rev=356&view=rev
Author:   warnes
Date: 2007-10-08 13:35:27 -0700 (Mon, 08 Oct 2007)

Log Message:
---
Testing whewther Numeric is present was broken.  Fixed.

Modified Paths:
--
trunk/rpy/setup.py

Modified: trunk/rpy/setup.py
===
--- trunk/rpy/setup.py  2007-10-08 20:33:53 UTC (rev 355)
+++ trunk/rpy/setup.py  2007-10-08 20:35:27 UTC (rev 356)
@@ -146,6 +146,7 @@
 except ImportError:
 # fall back to Numeric
 try:
+import Numeric
 DEFINE.append(('WITH_NUMERIC', '1'))
 except ImportError:
 UNDEF.append('WITH_NUMERIC')


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [357] trunk/rpy/src/rpymodule.c

2007-10-17 Thread warnes
Revision: 357
  http://rpy.svn.sourceforge.net/rpy/?rev=357&view=rev
Author:   warnes
Date: 2007-10-17 18:26:34 -0700 (Wed, 17 Oct 2007)

Log Message:
---
Handle python unicode strings in calls to R by first converting to python ascii 
strings

Modified Paths:
--
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2007-10-08 20:35:27 UTC (rev 356)
+++ trunk/rpy/src/rpymodule.c   2007-10-18 01:26:34 UTC (rev 357)
@@ -420,6 +420,22 @@
   COMPLEX_DATA(robj)[0].r = c.real;
   COMPLEX_DATA(robj)[0].i = c.imag;
 }
+  else if (PyUnicode_Check(obj))
+{
+  /** Handle Unicode Strings.
+   *
+   * Ideally:  Python Unicode -> R Unicode, 
+   *
+   * Unfortunately, the R documentation is not forthcoming on how
+   * to accomplish this 
+   *
+   * So, for the moment:  
+   * python Unicode -> Python ASCII -> ordinary string -> R string  
+   *
+   */
+  PROTECT(robj = NEW_STRING(1));
+  SET_STRING_ELT(robj, 0, 
COPY_TO_USER_STRING(PyString_AsString(PyUnicode_AsASCIIString(obj;
+}
   else if (PyString_Check(obj)) 
 {
   PROTECT(robj = NEW_STRING(1));


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [358] trunk/rpy/rpy_wintools.py

2007-10-17 Thread warnes
Revision: 358
  http://rpy.svn.sourceforge.net/rpy/?rev=358&view=rev
Author:   warnes
Date: 2007-10-17 18:36:48 -0700 (Wed, 17 Oct 2007)

Log Message:
---
Apply patch [ 1808836 ] Install-script tweaking for Windows

Modified Paths:
--
trunk/rpy/rpy_wintools.py

Modified: trunk/rpy/rpy_wintools.py
===
--- trunk/rpy/rpy_wintools.py   2007-10-18 01:26:34 UTC (rev 357)
+++ trunk/rpy/rpy_wintools.py   2007-10-18 01:36:48 UTC (rev 358)
@@ -11,8 +11,12 @@
   0,
   0)
 Rdir = os.path.join(program_files,"R")
-Rprogs = os.listdir(Rdir)
-Rhomes = map( lambda(x): os.path.join(Rdir, x), Rprogs)
+Rhomes = []
+if os.path.exists(Rdir):
+Rprogs = os.listdir(Rdir)
+Rhomes = map( lambda(x): os.path.join(Rdir, x), Rprogs)
+if os.environ.get('RHOME', None):
+Rhomes.insert(0, os.environ.get('RHOME', None))
 return Rhomes
 
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [359] trunk/rpy/src/rpymodule.c

2007-10-17 Thread warnes
Revision: 359
  http://rpy.svn.sourceforge.net/rpy/?rev=359&view=rev
Author:   warnes
Date: 2007-10-17 18:54:13 -0700 (Wed, 17 Oct 2007)

Log Message:
---
Remove unneeded comment

Modified Paths:
--
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2007-10-18 01:36:48 UTC (rev 358)
+++ trunk/rpy/src/rpymodule.c   2007-10-18 01:54:13 UTC (rev 359)
@@ -1749,7 +1749,6 @@
   Robj_Type.tp_alloc = PyType_GenericAlloc;
 #endif
 
-  //m = Py_InitModule(MacroQuote(RPY_SHNAME), rpy_methods);
   m = Py_InitModule(xstr(RPY_SHNAME), rpy_methods);
   d = PyModule_GetDict(m);
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [360] trunk/htdocs

2007-10-17 Thread warnes
Revision: 360
  http://rpy.svn.sourceforge.net/rpy/?rev=360&view=rev
Author:   warnes
Date: 2007-10-17 19:40:37 -0700 (Wed, 17 Oct 2007)

Log Message:
---
Fix spelling error

Modified Paths:
--
trunk/htdocs/download.data
trunk/htdocs/faithful.py

Modified: trunk/htdocs/download.data
===
--- trunk/htdocs/download.data  2007-10-18 01:54:13 UTC (rev 359)
+++ trunk/htdocs/download.data  2007-10-18 02:40:37 UTC (rev 360)
@@ -30,7 +30,7 @@
 http://starship.python.net/crew/mhammond/win32/Downloads.html";>
 Mark Hammond's Python extensions
  
-  (Convenently included as part of
+  (Conveniently included as part of
   http://www.activestate.com/Products/ActivePython/";>
 ActiveState Python
 )

Modified: trunk/htdocs/faithful.py
===
--- trunk/htdocs/faithful.py2007-10-18 01:54:13 UTC (rev 359)
+++ trunk/htdocs/faithful.py2007-10-18 02:40:37 UTC (rev 360)
@@ -30,8 +30,8 @@
 
 long_ed = filter(lambda x: x > 3, ed)
 r.png('faithful_ecdf.png',width=733,height=550)
-r.library('stepfun')
-r.plot(r.ecdf(long_ed), do_points=0, verticals=1, col="blue",
+r.library('stats')
+r.plot(r.ecdf(long_ed), do_points=0, verticals=1, 
main="Empirical cumulative distribution function of Old Faithful 
eruptions longer than 3 seconds")
 x = r.seq(3,5.4,0.01)
 r.lines(r.seq(3,5.4,0.01),r.pnorm(r.seq(3,5.4,0.01),mean=r.mean(long_ed), 
@@ -44,7 +44,6 @@
 r.qqline(long_ed,col="red")
 r.dev_off()
 
-r.library('ctest')
 print
 print "Shapiro-Wilks normality test of Old Faithful eruptions longer than 3 
seconds"
 sw = r.shapiro_test(long_ed)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [361] trunk/rpy/src/rpymodule.c

2007-10-18 Thread warnes
Revision: 361
  http://rpy.svn.sourceforge.net/rpy/?rev=361&view=rev
Author:   warnes
Date: 2007-10-18 12:40:51 -0700 (Thu, 18 Oct 2007)

Log Message:
---
More fixes for handling of Unicode strings.  Suggested by Toby Dylan Hocking.

Modified Paths:
--
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2007-10-18 02:40:37 UTC (rev 360)
+++ trunk/rpy/src/rpymodule.c   2007-10-18 19:40:51 UTC (rev 361)
@@ -182,6 +182,8 @@
 return ANY_T;
   else if (PyString_Check(obj))
 return STRING_T;
+  else if (PyUnicode_Check(obj))
+return STRING_T;
   else if (Robj_Check(obj))
 return ROBJ_T;
   else


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [362] trunk/rpy/src

2007-11-06 Thread warnes
Revision: 362
  http://rpy.svn.sourceforge.net/rpy/?rev=362&view=rev
Author:   warnes
Date: 2007-11-06 08:49:53 -0800 (Tue, 06 Nov 2007)

Log Message:
---
Apply patch submitted by Matthew Brett to resolve array size issues on 64 bit 
platforms

Modified Paths:
--
trunk/rpy/src/RPy.h
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/RPy.h
===
--- trunk/rpy/src/RPy.h 2007-10-18 19:40:51 UTC (rev 361)
+++ trunk/rpy/src/RPy.h 2007-11-06 16:49:53 UTC (rev 362)
@@ -91,12 +91,16 @@
 # if WITH_NUMERIC == 3
 #include "numpy/arrayobject.h"
 #define PY_ARRAY_MODULE_NAME "numpy"
+typedef npy_intp n_intp;
 # elif WITH_NUMERIC == 1
 #include "Numeric/arrayobject.h"
 #define PY_ARRAY_MODULE_NAME "multiarray"
+typedef int n_intp;
 # else
 #error "unknown array variant"
 # endif
+#else
+typedef int n_intp;
 #endif
 #define xstr(s) str(s)
 #define str(s) #s

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2007-10-18 19:40:51 UTC (rev 361)
+++ trunk/rpy/src/rpymodule.c   2007-11-06 16:49:53 UTC (rev 362)
@@ -314,7 +314,8 @@
   PyObject *pytl, *nobj;
   PyArrayObject *obj;
   SEXP Rdims, tRdims, Rarray, e;
-  int *dims, i;
+  n_intp *dims;
+  int i;
   long tl;
 
   obj = (PyArrayObject *)o;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [363] trunk/rpy

2007-11-12 Thread warnes
Revision: 363
  http://rpy.svn.sourceforge.net/rpy/?rev=363&view=rev
Author:   warnes
Date: 2007-11-12 15:27:48 -0800 (Mon, 12 Nov 2007)

Log Message:
---

- Add three new exceptions: 
RPyExceptionBase exception class for all RPy Exceptions
RPyTypeConversionException  Error in conversion between R and Python
RPyRException   Error raised within R

(RException is set equal to RPyException for backwards compatibility)

- Properly handle all Numeric/NumPy array types

- Solve 64 bit problems converting Numeric/NumPy arrays

Modified Paths:
--
trunk/rpy/TODO
trunk/rpy/rpy.py
trunk/rpy/setup.py
trunk/rpy/src/RPy.h
trunk/rpy/src/R_eval.c
trunk/rpy/src/rpymodule.c
trunk/rpy/tests/test_array.py
trunk/rpy/tests/test_numeric.py
trunk/rpy/tests/test_robj.py
trunk/rpy/tests/test_tor.py
trunk/rpy/tests/test_util.py

Modified: trunk/rpy/TODO
===
--- trunk/rpy/TODO  2007-11-06 16:49:53 UTC (rev 362)
+++ trunk/rpy/TODO  2007-11-12 23:27:48 UTC (rev 363)
@@ -1,6 +1,10 @@
 
 C=Critical, I=Important, U=Useful, O=Optional
 
+I* Update install instructions to include information about use of 'RHOMES'
+
+I* Ensure that either Numarray, Numeric, or NumPy can be used
+
 C* Properly clean up R when python exits, even if the user hasn't called 'q()'
 
 U* Posibility to pass Python functions to R functions

Modified: trunk/rpy/rpy.py
===
--- trunk/rpy/rpy.py2007-11-06 16:49:53 UTC (rev 362)
+++ trunk/rpy/rpy.py2007-11-12 23:27:48 UTC (rev 363)
@@ -169,9 +169,21 @@
 def get_default_mode():
 return _rpy.get_mode()
 
-# The new exception
-RException = _rpy.RException
+# Three new exceptions
+# base exception
+RPyException = _rpy.RPy_Exception;
 
+# R <-> Python conversion exception
+RPyTypeConversionException = _rpy.RPy_TypeConversionException;
+
+# Exception raised by R
+RPyRException = _rpy.RPy_RException
+
+# for backwards compatibility
+RException = RPyException
+
+
+
 # I/O setters
 set_rpy_output = _rpy.set_output
 set_rpy_input = _rpy.set_input

Modified: trunk/rpy/setup.py
===
--- trunk/rpy/setup.py  2007-11-06 16:49:53 UTC (rev 362)
+++ trunk/rpy/setup.py  2007-11-12 23:27:48 UTC (rev 363)
@@ -30,6 +30,8 @@
 See the files INSTALL.UNIX and INSTALL.WINDOWS for more details.
 """
 
+DEBUG=True
+
 import os, os.path, sys, shutil
 from distutils.core import setup, Extension
 from distutils.sysconfig import *
@@ -48,6 +50,7 @@
 RHOMES = []
 
 print "RHOMES=", RHOMES
+print "DEBUG=", DEBUG
 
 if not RHOMES:
 if sys.platform=="win32":
@@ -65,8 +68,12 @@

 RHOME = RHOME.strip()
 
-# to avoid strict prototypes errors from R includes
-get_config_vars()['OPT'] = '-DNDEBUG -g -O3 -Wall'
+if DEBUG:
+# to avoid strict prototypes errors from R includes
+get_config_vars()['OPT'] = '-g -Wall'
+else:
+# to avoid strict prototypes errors from R includes
+get_config_vars()['OPT'] = '-DNDEBUG -g -O3 -Wall'
 
 # get the Python version
 if sys.version[:3] >= '2.2':
@@ -137,12 +144,12 @@
 extra_compile_args=["-shared"]
 source_files = source_files + ["src/setenv.c"]
 
-# check whether NumPy is present
-try:
+# Discover which array packages are present
+try: 
 import numpy
 DEFINE.append(('WITH_NUMERIC', '3'))
 DEFINE.append(('PY_ARRAY_TYPES_PREFIX', 'PyArray_'))
-include_dirs.append(numpy.get_numpy_include())
+include_dirs.append(numpy.get_include())
 except ImportError:
 # fall back to Numeric
 try:
@@ -164,6 +171,9 @@
 DEFINE.append( ('RPY_SHNAME', shlib_name))
 DEFINE.append( ('INIT_RPY', 'init_rpy%s' % RVER ) )
 
+
+# add debugging 
+
 modules.append( Extension(
 shlib_name,
 source_files,

Modified: trunk/rpy/src/RPy.h
===
--- trunk/rpy/src/RPy.h 2007-11-06 16:49:53 UTC (rev 362)
+++ trunk/rpy/src/RPy.h 2007-11-12 23:27:48 UTC (rev 363)
@@ -130,10 +130,12 @@
 SEXP do_eval_fun(char *);
 SEXP get_fun_from_name(char *);
 
-/* A new exception */
-extern PyObject *RPyExc_Exception;
+/* Three new exception */
+extern PyObject *RPy_Exception;/* Base RPy exception  */
+extern PyObject *RPy_TypeConversionException;  /* R<->Python conversion errors 
*/
+extern PyObject *RPy_RException;   /* Errors from R */
 
-char *get_last_error_msg(void);
+const char *get_last_error_msg(void);
 
 /* For initiali

[Rpy] SF.net SVN: rpy: [364] trunk/rpy/setup.py

2007-11-12 Thread warnes
Revision: 364
  http://rpy.svn.sourceforge.net/rpy/?rev=364&view=rev
Author:   warnes
Date: 2007-11-12 22:13:22 -0800 (Mon, 12 Nov 2007)

Log Message:
---
Add /usr/share/R/include path for Ubuntu (?Debian?) R include files

Modified Paths:
--
trunk/rpy/setup.py

Modified: trunk/rpy/setup.py
===
--- trunk/rpy/setup.py  2007-11-12 23:27:48 UTC (rev 363)
+++ trunk/rpy/setup.py  2007-11-13 06:13:22 UTC (rev 364)
@@ -137,7 +137,7 @@
 source_files = source_files + ["src/setenv.c"]
 else: # unix-like systems, this is known to work for Linux and Solaris
 include_dirs = [ os.path.join(RHOME.strip(), 'include'), 
- 'src' ]
+ 'src', '/usr/share/R/include' ]
 libraries=['R','Rlapack']
 library_dirs = r_libs
 runtime_libs = r_libs


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [365] trunk/rpy/src/rpymodule.c

2007-11-12 Thread warnes
Revision: 365
  http://rpy.svn.sourceforge.net/rpy/?rev=365&view=rev
Author:   warnes
Date: 2007-11-12 22:26:05 -0800 (Mon, 12 Nov 2007)

Log Message:
---
More work on handling Numeric/NumPy array and scalar objects.  Only NumPy 
string/unicode/char objects are still unhandled, AFAIK.

Modified Paths:
--
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2007-11-13 06:13:22 UTC (rev 364)
+++ trunk/rpy/src/rpymodule.c   2007-11-13 06:26:05 UTC (rev 365)
@@ -363,84 +363,99 @@
 /***/
 /* String Variants */
 /***/
-#ifdef PyArray_UNICODE  /* NumPy */
-case PyArray_UNICODE:
-case PyArray_STRING:
-case PyArray_CHAR:
-  obj = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)obj,
+/* TODO: Add proper handling of NumPy character arrays.  
+ The following code DOES NOT WORK: 
+
+#if WITH_NUMERIC==3 
+case PyArray_UNICODE:
+case PyArray_STRING:
+case PyArray_CHAR:
+  obj = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject 
*)obj,
  PyArray_STRING, 0, 0);
-#endif
+#endif
 
+  The problem is that the PyArray call throws an exception,
+  presumably because we haven't given a width specifier.   
+  
+  NumPy strings are fixed-width, and may not be null terminated.  R only 
handles
+  null terminated (varying width) strings.  We need a separate
+  code path to handle this, as it requires quite different
+  handling than the numeric arrays dealt with below.
+*/
+
+
 /**/
-/* All complex to (double,double) complex  */
+/* All complex to (double,double) complex */
 /**/
-#ifdef PyArray_COMPLEX64
+
+#if WITH_NUMERIC==1   /* Numeric */
+case PyArray_CFLOAT:
+case PyArray_CDOUBLE:
+#else/* NumPy */
 case PyArray_COMPLEX64:
 case PyArray_COMPLEX128:
 #endif
-case PyArray_CFLOAT:
-case PyArray_CDOUBLE:
   obj = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)obj,
  PyArray_CDOUBLE, 0, 
0);
   break; 
 
-#ifdef PyArray_BOOL
-   //
-   /* Booleans to booleans */
-   //
-case PyArray_BOOL:
-  obj = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)obj,
- PyArray_BOOL, 0, 0);
-  break; 
-#endif
 
-
//
-/* All integers (except perhaps 64 bit integers on 32 bit platforms) to 
integer */
-
//
+
/**/
+/* Convert all integers to platform integer (except 64 bit int on 32 bit 
platforms) */
+
//
+
+#if WITH_NUMERIC==1  /* Numeric */
 case PyArray_UBYTE:
 case PyArray_SBYTE:
 case PyArray_SHORT:
 case PyArray_INT:
 case PyArray_LONG:
-#ifdef PyArray_INT8
+  obj = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)obj,
+ PyArray_INT, 0, 0);
+  break;
+#else/* NumPy */
+case PyArray_BOOL:
 case PyArray_INT8:
-case PyArray_UINT8:
+case PyArray_UINT8: 
 case PyArray_INT16:
 case PyArray_UINT16:
 case PyArray_INT32:
 case PyArray_UINT32:
-#endif
-#if SIZEOF_INT == 8 && defined(PyArray_INT64) /* NumPy on 64 bit platform */
+#if PyArray_INT==PyArray_INT64 /* 64 bit platform */
 case PyArray_INT64:
 case PyArray_UINT64:
-#endif
+#else
   obj = (PyArrayObject *)PyArray_ContiguousFromObject((PyObject *)obj,
  PyArray_INT, 0, 0);
   break;
+#endif
+#endif
 
 /**/
 /* All floats (and over-sized integers) to double */
 /**/
+#if WITH_NUMERIC==1   /* Numeric */
 case PyArray_FLOAT:
 case PyArray_DOUBLE:
-#ifdef PyArray_FLOAT32
+#else /* NumPy */
 case PyArray_FLOAT32:
 case PyArray_FLOAT64:
-#endif
-#if SIZEOF_INT == 4 && defined(PyArray_INT64) /* NumPy on 32 bit platform */
+#if PyArray_INT!=PyArray_INT64 /* 32 bit platform */
 case PyArray_INT64:
 case PyArray_UINT64:
 #endif
+#endif
   obj = (PyArrayObject *)PyArray_ContiguousF

[Rpy] SF.net SVN: rpy: [366] trunk/rpy/tests

2007-11-12 Thread warnes
Revision: 366
  http://rpy.svn.sourceforge.net/rpy/?rev=366&view=rev
Author:   warnes
Date: 2007-11-12 22:27:31 -0800 (Mon, 12 Nov 2007)

Log Message:
---
Fix array test to explicitly check elements of 3 dimensional objects for 
equality.

Modified Paths:
--
trunk/rpy/tests/test_array.py
trunk/rpy/tests/test_numeric.py

Modified: trunk/rpy/tests/test_array.py
===
--- trunk/rpy/tests/test_array.py   2007-11-13 06:26:05 UTC (rev 365)
+++ trunk/rpy/tests/test_array.py   2007-11-13 06:27:31 UTC (rev 366)
@@ -15,9 +15,23 @@
 idx.autoconvert(BASIC_CONVERSION)
 return o
 
-def all(vec):
-for i in range(len(vec)):
-  if not vec[i]: return False
+def all_equal_3d(vec1, vec2):
+
+if len(vec1) != len(vec2): return False
+
+for i in range(len(vec1)):
+
+if len(vec1[i]) != len(vec2[i]): return False
+
+for j in range( len(vec1[i]) ):
+
+if len(vec1[i][j])!=len(vec2[i][j]): return False
+
+for k in range( len(vec1[i][j]) ):
+
+if vec1[i][j][k] != vec2[i][j][k]: return False
+
+
 return True
  
 
@@ -34,7 +48,7 @@
 r.array.autoconvert(BASIC_CONVERSION)
 
 def testConversionToPy(self):
-self.failUnless(all(self.py == self.ra.as_py()),
+self.failUnless(all_equal_3d(self.py,self.ra.as_py()),
 'wrong conversion to Python')
 
 def testConversionToR(self):

Modified: trunk/rpy/tests/test_numeric.py
===
--- trunk/rpy/tests/test_numeric.py 2007-11-13 06:26:05 UTC (rev 365)
+++ trunk/rpy/tests/test_numeric.py 2007-11-13 06:27:31 UTC (rev 366)
@@ -79,7 +79,7 @@
 def testROutOfBounds(self):
 self.failUnlessRaises(RPyException, lambda: idx(self.ra_c, 5,5,5))
 
-def test64BitIntArrays(self):
+def test64BitIntArray(self):
 
 # 64 bit ints
 try:
@@ -91,10 +91,9 @@
 print "\nInt64 Not found.  Skipping this test.\n"
 return
 
-b = r.c(a[1])
 b = r.c(a)
 
-def test32BitIntArrays(self):
+def test32BitIntArray(self):
 
 # 32 bit ints
 try:
@@ -102,10 +101,9 @@
 except:
 a = array( [1,2,3], Int32 )
 
-b = r.c(a[1])
 b = r.c(a)
 
-def test16BitIntArrays(self):
+def test16BitIntArray(self):
 
 # 16 bit ints
 try:
@@ -113,21 +111,31 @@
 except:
 a = array( [1,2,3], Int16 )
 
-b = r.c(a[1])
 b = r.c(a)
 
-def test8BitIntArrays(self):
+def test8BitIntArray(self):
 
 # 8 bit ints
 try:
 a = array( [1,2,3], 'Int8' )
 except:
 a = array( [1,2,3], Int8 )
-b = r.c(a[1])
+
 b = r.c(a)
 
-def test64BitFloatArrays(self):
+def testBoolArray(self):
 
+# 8 bit ints
+try:
+a = array( [1,2,3], 'Bool' )
+except:
+print "Bool arrays not supported by Numeric, skipping"
+return
+
+b = r.c(a)
+
+def test64BitFloatArray(self):
+
 # 64 bit ints
 try:
 a = array( [1,2,3], 'Float64' )
@@ -138,10 +146,9 @@
 print  "Float64 Not found.  Skipping this test."
 return
 
-b = r.c(a[1])
 b = r.c(a)
 
-def test32BitFloatArrays(self):
+def test32BitFloatArray(self):
 
 # 32 bit ints
 try:
@@ -149,27 +156,160 @@
 except:
 a = array( [1,2,3], Float32 )
 
-b = r.c(a[1])
 b = r.c(a)
 
-def testCharArrays(self):
+def testCharArray(self):
 
 try:
-a = array( ['A','B', 'C'], 'Char' )
+a = array( ['A','B', 'C'], character )
 except:
 a = array( ['A','B', 'C'], Character )
 
 self.failUnlessRaises(RPyTypeConversionException, lambda: r.c(a) )
 
-def testObjArrays(self):
 
+def testStringArray(self):
+
 try:
-a = array( ['A','B', 'C'], 'PyObject' )
+a = array( ['ABCDEFHIJKLM','B', 'C C C'], 'S10' )
+except: # not available on Numeric
+print "String arrays not supported by Numeric, skipping"
+return
+
+self.failUnlessRaises(RPyTypeConversionException, lambda: r.c(a) )
+
+
+def testObjArray(self):
+
+try:
+a = array( ['A','B', 'C'], 'object' )
 except:
 a = array( ['A','B'

[Rpy] SF.net SVN: rpy: [367] trunk/rpy/tests/test_numeric.py

2007-11-12 Thread warnes
Revision: 367
  http://rpy.svn.sourceforge.net/rpy/?rev=367&view=rev
Author:   warnes
Date: 2007-11-12 22:43:02 -0800 (Mon, 12 Nov 2007)

Log Message:
---
Select which syntax variant to use by which library was loaded, rather than 
using try:except to try a second variance after the first failed.

Modified Paths:
--
trunk/rpy/tests/test_numeric.py

Modified: trunk/rpy/tests/test_numeric.py
===
--- trunk/rpy/tests/test_numeric.py 2007-11-13 06:27:31 UTC (rev 366)
+++ trunk/rpy/tests/test_numeric.py 2007-11-13 06:43:02 UTC (rev 367)
@@ -4,9 +4,11 @@
 import sys
 try:
 from numpy import *
+ArrayLib='NumPy'
 except ImportError:
 try:
 from Numeric import *
+ArrayLib='Numeric'
 except ImportError:
 print '\nNumeric not available. Skipping.\n'
 sys.exit(0)
@@ -83,22 +85,22 @@
 
 # 64 bit ints
 try:
-a = array( [1,2,3], 'Int64' )
-except:
-try:
+if(ArrayLib=='NumPy'):
+a = array( [1,2,3], 'Int64' )
+else:
 a = array( [1,2,3], Int64 )
-except:
-print "\nInt64 Not found.  Skipping this test.\n"
-return
+except:
+print "\nInt64 Not found.  Skipping this test.\n"
+return
 
 b = r.c(a)
 
 def test32BitIntArray(self):
 
 # 32 bit ints
-try:
+if(ArrayLib=='NumPy'):
 a = array( [1,2,3], 'Int32' )
-except:
+else:
 a = array( [1,2,3], Int32 )
 
 b = r.c(a)
@@ -106,9 +108,9 @@
 def test16BitIntArray(self):
 
 # 16 bit ints
-try:
+if(ArrayLib=='NumPy'):
 a = array( [1,2,3], 'Int16' )
-except:
+else:
 a = array( [1,2,3], Int16 )
 
 b = r.c(a)
@@ -116,9 +118,9 @@
 def test8BitIntArray(self):
 
 # 8 bit ints
-try:
+if(ArrayLib=='NumPy'):
 a = array( [1,2,3], 'Int8' )
-except:
+else:
 a = array( [1,2,3], Int8 )
 
 b = r.c(a)
@@ -126,9 +128,9 @@
 def testBoolArray(self):
 
 # 8 bit ints
-try:
+if(ArrayLib=='NumPy'):
 a = array( [1,2,3], 'Bool' )
-except:
+else:
 print "Bool arrays not supported by Numeric, skipping"
 return
 
@@ -138,31 +140,31 @@
 
 # 64 bit ints
 try:
-a = array( [1,2,3], 'Float64' )
-except:
-try:
+if(ArrayLib=='NumPy'):
+a = array( [1,2,3], 'Float64' )
+else:
 a = array( [1,2,3], Float64 )
-except:
-print  "Float64 Not found.  Skipping this test."
-return
+except:
+print  "Float64 Not found.  Skipping this test."
+return
 
 b = r.c(a)
 
 def test32BitFloatArray(self):
 
 # 32 bit ints
-try:
+if(ArrayLib=='NumPy'):
 a = array( [1,2,3], 'Float32' )
-except:
+else:
 a = array( [1,2,3], Float32 )
 
 b = r.c(a)
 
 def testCharArray(self):
 
-try:
+if(ArrayLib=='NumPy'):
 a = array( ['A','B', 'C'], character )
-except:
+else:
 a = array( ['A','B', 'C'], Character )
 
 self.failUnlessRaises(RPyTypeConversionException, lambda: r.c(a) )
@@ -170,9 +172,9 @@
 
 def testStringArray(self):
 
-try:
+if(ArrayLib=='NumPy'):
 a = array( ['ABCDEFHIJKLM','B', 'C C C'], 'S10' )
-except: # not available on Numeric
+else: # not available on Numeric
 print "String arrays not supported by Numeric, skipping"
 return
 
@@ -181,12 +183,12 @@
 
 def testObjArray(self):
 
-try:
+if(ArrayLib=='NumPy'):
 a = array( ['A','B', 'C'], 'object' )
-except:
+else:
 a = array( ['A','B', 'C'], PyObject )
 
-self.failUnlessRaises(RPyTypeConversionException,  lambda: r.c(a))
+self.failUnlessRaises(RPyTypeConversionException, lambda: r.c(a) )
 
 
 
@@ -194,22 +196,22 @@
 
 # 64 bit ints
 try:
-a = array( [1,2,3], 'Int64' )
-except:
-try:
+if(ArrayLib=='NumP

[Rpy] SF.net SVN: rpy: [368] trunk/rpy/tests/test_numeric.py

2007-11-13 Thread warnes
Revision: 368
  http://rpy.svn.sourceforge.net/rpy/?rev=368&view=rev
Author:   warnes
Date: 2007-11-13 07:28:04 -0800 (Tue, 13 Nov 2007)

Log Message:
---
Minor reformatting of test_numeric.py

Modified Paths:
--
trunk/rpy/tests/test_numeric.py

Modified: trunk/rpy/tests/test_numeric.py
===
--- trunk/rpy/tests/test_numeric.py 2007-11-13 06:43:02 UTC (rev 367)
+++ trunk/rpy/tests/test_numeric.py 2007-11-13 15:28:04 UTC (rev 368)
@@ -163,9 +163,9 @@
 def testCharArray(self):
 
 if(ArrayLib=='NumPy'):
-a = array( ['A','B', 'C'], character )
+a = array( ['A', 'B', 'C'], character )
 else:
-a = array( ['A','B', 'C'], Character )
+a = array( ['A', 'B', 'C'], Character )
 
 self.failUnlessRaises(RPyTypeConversionException, lambda: r.c(a) )
 
@@ -173,7 +173,7 @@
 def testStringArray(self):
 
 if(ArrayLib=='NumPy'):
-a = array( ['ABCDEFHIJKLM','B', 'C C C'], 'S10' )
+a = array( ['ABCDEFHIJKLM', 'B', 'C C C'], 'S10' )
 else: # not available on Numeric
 print "String arrays not supported by Numeric, skipping"
 return
@@ -274,9 +274,9 @@
 def testCharScalar(self):
 
 if(ArrayLib=='NumPy'):
-a = array( ['A','B', 'C'], character )
+a = array( ['A', 'B', 'C'], character )
 else:
-a = array( ['A','B', 'C'], Character )
+a = array( ['A', 'B', 'C'], Character )
 
 self.failUnless( r.c(a[0])=='A' )
 
@@ -284,7 +284,7 @@
 def testStringScalar(self):
 
 if(ArrayLib=='NumPy'):
-a = array( ['ABCDEFHIJKLM','B', 'C C C'], 'S10' )
+a = array( ['ABCDEFHIJKLM', 'B', 'C C C'], 'S10' )
 else: # not available on Numeric
 print "String arrays not supported by Numeric, skipping"
 return
@@ -295,9 +295,9 @@
 def testObjScalar(self):
 
 if(ArrayLib=='NumPy'):
-a = array( ['A','B', 'C'], 'object' )
+a = array( ['A', 'B', 'C'], 'object' )
 else:
-a = array( ['A','B', 'C'], PyObject )
+a = array( ['A', 'B', 'C'], PyObject )
 
 self.failUnless( r.c(a[0])=='A' )
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [369] trunk/rpy/tests/test_numeric.py

2007-11-13 Thread warnes
Revision: 369
  http://rpy.svn.sourceforge.net/rpy/?rev=369&view=rev
Author:   warnes
Date: 2007-11-13 07:35:33 -0800 (Tue, 13 Nov 2007)

Log Message:
---
Numeric.Character isn't handled (yet?), so modify test appropriately

Modified Paths:
--
trunk/rpy/tests/test_numeric.py

Modified: trunk/rpy/tests/test_numeric.py
===
--- trunk/rpy/tests/test_numeric.py 2007-11-13 15:28:04 UTC (rev 368)
+++ trunk/rpy/tests/test_numeric.py 2007-11-13 15:35:33 UTC (rev 369)
@@ -275,21 +275,23 @@
 
 if(ArrayLib=='NumPy'):
 a = array( ['A', 'B', 'C'], character )
+self.failUnless( r.c(a[0])=='A' )
 else:
+# RPy does not handle translation oc Numeric.Character objects
 a = array( ['A', 'B', 'C'], Character )
+self.failUnlessRaises( RPyTypeConversionException, 
lambda:r.c(a[0])=='A' )
 
-self.failUnless( r.c(a[0])=='A' )
 
-
 def testStringScalar(self):
 
 if(ArrayLib=='NumPy'):
 a = array( ['ABCDEFHIJKLM', 'B', 'C C C'], 'S10' )
-else: # not available on Numeric
+self.failUnless( r.c(a[0])=='ABCDEFHIJK' )
+else:
+# String class not available on Numeric
 print "String arrays not supported by Numeric, skipping"
 return
 
-self.failUnless( r.c(a[0])=='ABCDEFHIJK' )
 
 
 def testObjScalar(self):


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [370] trunk/rpy/tests/test_numeric.py

2007-11-13 Thread warnes
Revision: 370
  http://rpy.svn.sourceforge.net/rpy/?rev=370&view=rev
Author:   warnes
Date: 2007-11-13 07:37:49 -0800 (Tue, 13 Nov 2007)

Log Message:
---
Improve display of messages about tests being skipped

Modified Paths:
--
trunk/rpy/tests/test_numeric.py

Modified: trunk/rpy/tests/test_numeric.py
===
--- trunk/rpy/tests/test_numeric.py 2007-11-13 15:35:33 UTC (rev 369)
+++ trunk/rpy/tests/test_numeric.py 2007-11-13 15:37:49 UTC (rev 370)
@@ -131,7 +131,7 @@
 if(ArrayLib=='NumPy'):
 a = array( [1,2,3], 'Bool' )
 else:
-print "Bool arrays not supported by Numeric, skipping"
+print "\nBool arrays not supported by Numeric, skipping\n"
 return
 
 b = r.c(a)
@@ -145,7 +145,7 @@
 else:
 a = array( [1,2,3], Float64 )
 except:
-print  "Float64 Not found.  Skipping this test."
+print  "\nFloat64 Not found.  Skipping this test.\n"
 return
 
 b = r.c(a)
@@ -175,7 +175,7 @@
 if(ArrayLib=='NumPy'):
 a = array( ['ABCDEFHIJKLM', 'B', 'C C C'], 'S10' )
 else: # not available on Numeric
-print "String arrays not supported by Numeric, skipping"
+print "\nString arrays not supported by Numeric, skipping\n"
 return
 
 self.failUnlessRaises(RPyTypeConversionException, lambda: r.c(a) )
@@ -242,7 +242,7 @@
 if(ArrayLib=='NumPy'):
 a = array( [1,2,3], 'Bool' )
 else:
-print "Bool arrays not supported by Numeric, skipping"
+print "\nBool arrays not supported by Numeric, skipping\n"
 return
 
 b = r.c(a[0])
@@ -256,7 +256,7 @@
 else:
 a = array( [1,2,3], Float64 )
 except:
-print  "Float64 Not found.  Skipping this test."
+print  "\nFloat64 Not found.  Skipping this test.\n"
 return
 
 b = r.c(a[0])
@@ -289,7 +289,7 @@
 self.failUnless( r.c(a[0])=='ABCDEFHIJK' )
 else:
 # String class not available on Numeric
-print "String arrays not supported by Numeric, skipping"
+print "\nString arrays not supported by Numeric, skipping\n"
 return
 
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [371] trunk/rpy/tests/test_numeric.py

2007-11-13 Thread warnes
Revision: 371
  http://rpy.svn.sourceforge.net/rpy/?rev=371&view=rev
Author:   warnes
Date: 2007-11-13 07:41:25 -0800 (Tue, 13 Nov 2007)

Log Message:
---
Improve display of messages about tests being skipped (more)

Modified Paths:
--
trunk/rpy/tests/test_numeric.py

Modified: trunk/rpy/tests/test_numeric.py
===
--- trunk/rpy/tests/test_numeric.py 2007-11-13 15:37:49 UTC (rev 370)
+++ trunk/rpy/tests/test_numeric.py 2007-11-13 15:41:25 UTC (rev 371)
@@ -90,7 +90,7 @@
 else:
 a = array( [1,2,3], Int64 )
 except:
-print "\nInt64 Not found.  Skipping this test.\n"
+print "\nInt64 not found (32 bit platform?), skipping this test.\n"
 return
 
 b = r.c(a)
@@ -131,22 +131,17 @@
 if(ArrayLib=='NumPy'):
 a = array( [1,2,3], 'Bool' )
 else:
-print "\nBool arrays not supported by Numeric, skipping\n"
+print "\nBool arrays not supported by Numeric, skipping this 
test.\n"
 return
 
 b = r.c(a)
 
 def test64BitFloatArray(self):
 
-# 64 bit ints
-try:
-if(ArrayLib=='NumPy'):
-a = array( [1,2,3], 'Float64' )
-else:
-a = array( [1,2,3], Float64 )
-except:
-print  "\nFloat64 Not found.  Skipping this test.\n"
-return
+if(ArrayLib=='NumPy'):
+a = array( [1,2,3], 'Float64' )
+else:
+a = array( [1,2,3], Float64 )
 
 b = r.c(a)
 
@@ -175,7 +170,7 @@
 if(ArrayLib=='NumPy'):
 a = array( ['ABCDEFHIJKLM', 'B', 'C C C'], 'S10' )
 else: # not available on Numeric
-print "\nString arrays not supported by Numeric, skipping\n"
+print "\nString arrays not supported by Numeric, skipping this 
test.\n"
 return
 
 self.failUnlessRaises(RPyTypeConversionException, lambda: r.c(a) )
@@ -201,7 +196,7 @@
 else:
 a = array( [1,2,3], Int64 )
 except: 
-print "\nInt64 Not found.  Skipping this test.\n"
+print "\nInt64 not found (32 bit platform?), skipping this test.\n"
 return
 
 b = r.c(a[0])
@@ -242,28 +237,22 @@
 if(ArrayLib=='NumPy'):
 a = array( [1,2,3], 'Bool' )
 else:
-print "\nBool arrays not supported by Numeric, skipping\n"
+print "\nBool arrays not supported by Numeric, skipping this 
test.\n"
 return
 
 b = r.c(a[0])
 
 def test64BitFloatScalar(self):
 
-# 64 bit ints
-try:
-if(ArrayLib=='NumPy'):
-a = array( [1,2,3], 'Float64' )
-else:
-a = array( [1,2,3], Float64 )
-except:
-print  "\nFloat64 Not found.  Skipping this test.\n"
-return
-
+if(ArrayLib=='NumPy'):
+a = array( [1,2,3], 'Float64' )
+else:
+a = array( [1,2,3], Float64 )
+
 b = r.c(a[0])
 
 def test32BitFloatScalar(self):
 
-# 32 bit ints
 if(ArrayLib=='NumPy'):
 a = array( [1,2,3], 'Float32' )
 else:
@@ -289,7 +278,7 @@
 self.failUnless( r.c(a[0])=='ABCDEFHIJK' )
 else:
 # String class not available on Numeric
-print "\nString arrays not supported by Numeric, skipping\n"
+print "\nString arrays not supported by Numeric, skipping this 
test.\n"
 return
 
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [372] trunk/rpy/tests/testall.py

2007-11-13 Thread warnes
Revision: 372
  http://rpy.svn.sourceforge.net/rpy/?rev=372&view=rev
Author:   warnes
Date: 2007-11-13 08:24:29 -0800 (Tue, 13 Nov 2007)

Log Message:
---
Add ability to loop over test cases

Modified Paths:
--
trunk/rpy/tests/testall.py

Modified: trunk/rpy/tests/testall.py
===
--- trunk/rpy/tests/testall.py  2007-11-13 15:41:25 UTC (rev 371)
+++ trunk/rpy/tests/testall.py  2007-11-13 16:24:29 UTC (rev 372)
@@ -16,17 +16,28 @@
 modules = os.listdir('.')
 
 if '--random' in sys.argv:
-random.shuffle(modules)
+shuffle=True
 sys.argv.remove('--random')
+else:
+shuffle=False
 
+if '--loop' in sys.argv:
+   niter = 1000
+sys.argv.remove('--loop')
+else:
+   niter = 1
+
+
 modules = filter( lambda x: not x.endswith('.pyc'), modules)
 modules = filter( lambda x: x.startswith('test_'), modules)
 modules = filter( lambda x: x.endswith('.py'), modules)
 
 print "Modules to be tested:", modules
 
-for module in modules:
-print 'Testing:', module[5:-3]
-rpy.set_default_mode(rpy.NO_DEFAULT)  # reset to base case
-name = module[:-3]
-run(name)
+for iter in range(niter):
+if shuffle: random.shuffle(modules)
+for module in modules:
+name = module[:-3]
+print 'Testing:', name
+rpy.set_default_mode(rpy.NO_DEFAULT)  # reset to base case
+run(name)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [374] trunk/rpy/tests/test_numeric.py

2007-11-14 Thread warnes
Revision: 374
  http://rpy.svn.sourceforge.net/rpy/?rev=374&view=rev
Author:   warnes
Date: 2007-11-14 19:47:30 -0800 (Wed, 14 Nov 2007)

Log Message:
---
Change function to_r used in tests to make it more reliable

Modified Paths:
--
trunk/rpy/tests/test_numeric.py

Modified: trunk/rpy/tests/test_numeric.py
===
--- trunk/rpy/tests/test_numeric.py 2007-11-15 03:22:18 UTC (rev 373)
+++ trunk/rpy/tests/test_numeric.py 2007-11-15 03:47:30 UTC (rev 374)
@@ -21,8 +21,15 @@
 idx.autoconvert(NO_CONVERSION)
 
 def to_r(obj):
-r.list.autoconvert(NO_CONVERSION)
-return idx(r.list(obj),1)
+# For some reason, these two lines stop working after a few
+# iterations of `testall.py --loop'.  I'm not sure why
+#r.list.autoconvert(NO_CONVERSION) 
+#return idx(r.list(obj),1)
+# These three lines accomplish the same thing, but more
+# doesn't stop working after a few iterations.
+f = r("function(x) x")
+f.autoconvert(NO_CONVERSION)
+return f(obj)
 
 class ArrayTestCase(unittest.TestCase):
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [373] trunk/rpy/tests/test_io.py

2007-11-14 Thread warnes
Revision: 373
  http://rpy.svn.sourceforge.net/rpy/?rev=373&view=rev
Author:   warnes
Date: 2007-11-14 19:22:18 -0800 (Wed, 14 Nov 2007)

Log Message:
---
Add code to test_io to return io redirection to initial state after each test

Modified Paths:
--
trunk/rpy/tests/test_io.py

Modified: trunk/rpy/tests/test_io.py
===
--- trunk/rpy/tests/test_io.py  2007-11-13 16:24:29 UTC (rev 372)
+++ trunk/rpy/tests/test_io.py  2007-11-15 03:22:18 UTC (rev 373)
@@ -17,6 +17,10 @@
 def tearDown(self):
 sys.stdout = sys.__stdout__
 sys.stderr = sys.__stderr__
+# reset i/o defaults
+set_rpy_output(rpy_io.rpy_output)
+set_rpy_input(rpy_io.rpy_input)
+
 
 def testIOstdin(self):
 def dummy(prompt, n):


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [377] trunk/rpy/rpy_version.py

2007-11-14 Thread warnes
Revision: 377
  http://rpy.svn.sourceforge.net/rpy/?rev=377&view=rev
Author:   warnes
Date: 2007-11-14 20:59:59 -0800 (Wed, 14 Nov 2007)

Log Message:
---
update version to 1.0.0 (after thinking about it)

Modified Paths:
--
trunk/rpy/rpy_version.py

Modified: trunk/rpy/rpy_version.py
===
--- trunk/rpy/rpy_version.py2007-11-15 04:17:09 UTC (rev 376)
+++ trunk/rpy/rpy_version.py2007-11-15 04:59:59 UTC (rev 377)
@@ -1 +1 @@
-rpy_version = "1.1-Beta1"
+rpy_version = "1.0.0"


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [378] trunk/rpy/NEWS

2007-11-14 Thread warnes
Revision: 378
  http://rpy.svn.sourceforge.net/rpy/?rev=378&view=rev
Author:   warnes
Date: 2007-11-14 21:24:30 -0800 (Wed, 14 Nov 2007)

Log Message:
---
Update for v 1.0.0

Modified Paths:
--
trunk/rpy/NEWS

Modified: trunk/rpy/NEWS
===
--- trunk/rpy/NEWS  2007-11-15 04:59:59 UTC (rev 377)
+++ trunk/rpy/NEWS  2007-11-15 05:24:30 UTC (rev 378)
@@ -1,3 +1,69 @@
+CHANGES IN RPY 1.0.0 - 2007-11-15
+-
+
+New Features:
+
+  - Complete support for NumPy
+
+  - Add new exception types to provide better information on the
+source of the error:
+
+  RPyException: Base exception class for all RPy Exceptions
+
+  RPyTypeConversionException: Error in conversion between R
+  and Python
+
+  RPyRException Error raised within R
+
+  (RException is set equal to RPyException for backwards
+ compatibility)
+
+Bug Fixes:
+
+  - All Numeric and NumPy data types are either properly handled, or
+an appropriate exception is generated. 
+
+  - Properly handle unicode strings.
+
+  - Fix silent failure to start up on Win32 
+
+Other:
+
+  - Misc improvments to the test code.
+
+CHANGES IN RPY 1.0 RC 3 - 2007-06-26
+
+
+Bug Fixes:
+
+  - Only apply code to fix C Stack Limit error to recent versions of
+R that require the fix. 
+
+
+CHANGES IN RPY 1.0 RC 2 - 2007-05-18
+
+
+New Features:
+
+  - Initial work to provide support for NumPy
+
+Bug Fixes:
+
+  - Fix "C stack limit" error produced by R in some contexts
+
+  - Moved some code so no longer necessary to have R/bin in PATH
+
+  - Skip tests for features not supported on Win32
+
+CHANGES in RPY 1.0 RC 1 - 2006-08-08
+
+
+Bug Fixes
+
+   - Improve R version parsing to cope with new R startup message
+
+
+
 CHANGES IN RPY 0.99.2 - 2006-03-24
 --
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [376] trunk/rpy/rpy_version.py

2007-11-14 Thread warnes
Revision: 376
  http://rpy.svn.sourceforge.net/rpy/?rev=376&view=rev
Author:   warnes
Date: 2007-11-14 20:17:09 -0800 (Wed, 14 Nov 2007)

Log Message:
---
update version to 1.1-Beta1

Modified Paths:
--
trunk/rpy/rpy_version.py

Modified: trunk/rpy/rpy_version.py
===
--- trunk/rpy/rpy_version.py2007-11-15 04:08:11 UTC (rev 375)
+++ trunk/rpy/rpy_version.py2007-11-15 04:17:09 UTC (rev 376)
@@ -1 +1 @@
-rpy_version = "1.0-RC3"
+rpy_version = "1.1-Beta1"


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [375] trunk/rpy/tests/test_modes.py

2007-11-14 Thread warnes
Revision: 375
  http://rpy.svn.sourceforge.net/rpy/?rev=375&view=rev
Author:   warnes
Date: 2007-11-14 20:08:11 -0800 (Wed, 14 Nov 2007)

Log Message:
---
Comment out gc code, only needed when debugging

Modified Paths:
--
trunk/rpy/tests/test_modes.py

Modified: trunk/rpy/tests/test_modes.py
===
--- trunk/rpy/tests/test_modes.py   2007-11-15 03:47:30 UTC (rev 374)
+++ trunk/rpy/tests/test_modes.py   2007-11-15 04:08:11 UTC (rev 375)
@@ -4,9 +4,11 @@
 import sys
 sys.path.insert(1, "..")
 from rpy import *
-import gc
-gc.set_debug(gc.DEBUG_LEAK)
 
+# only needed when debugging 
+#import gc
+#gc.set_debug(gc.DEBUG_LEAK)
+
 class ModeConversionTestCase(unittest.TestCase):
 def setUp(self):
 set_default_mode(NO_DEFAULT)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
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] SF.net SVN: rpy: [380] trunk/rpy/src

2007-11-29 Thread warnes
Revision: 380
  http://rpy.svn.sourceforge.net/rpy/?rev=380&view=rev
Author:   warnes
Date: 2007-11-29 07:59:45 -0800 (Thu, 29 Nov 2007)

Log Message:
---
Apply tiny patch to fix Win32 startup problem.

Modified Paths:
--
trunk/rpy/src/RPy.h
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/RPy.h
===
--- trunk/rpy/src/RPy.h 2007-11-20 02:18:57 UTC (rev 379)
+++ trunk/rpy/src/RPy.h 2007-11-29 15:59:45 UTC (rev 380)
@@ -161,6 +161,8 @@
 extern void R_WriteConsole(char *, int);
 extern int  R_ReadConsole(char *, unsigned char *, int, int);
 extern void R_ProcessEvents(void);
+
+/* Windows R DLL Calls */
 extern char *getDLLVersion();
 extern void R_DefParams(Rstart);
 extern void R_SetParams(Rstart);

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2007-11-20 02:18:57 UTC (rev 379)
+++ trunk/rpy/src/rpymodule.c   2007-11-29 15:59:45 UTC (rev 380)
@@ -1813,7 +1813,7 @@
   R_DefParams(Rp);
 
   /* set R_HOME */
-  Rp->rhome = xstr(RHOME);
+  Rp->rhome = RHOME;
 
   index = strlen(RUSER) - 1;
   


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [381] trunk/rpy/setup.py

2007-11-29 Thread warnes
Revision: 381
  http://rpy.svn.sourceforge.net/rpy/?rev=381&view=rev
Author:   warnes
Date: 2007-11-29 08:06:18 -0800 (Thu, 29 Nov 2007)

Log Message:
---
ensure RHOMES is in ascii, since most command line tools are unhappy with 
unicode...

Modified Paths:
--
trunk/rpy/setup.py

Modified: trunk/rpy/setup.py
===
--- trunk/rpy/setup.py  2007-11-29 15:59:45 UTC (rev 380)
+++ trunk/rpy/setup.py  2007-11-29 16:06:18 UTC (rev 381)
@@ -59,6 +59,9 @@
 RHOMES = [rpy_tools.get_R_HOME(force_exec=False)]
 print "Setting RHOMES to ", RHOMES
 
+# ensure RHOMES is in ascii, since most command line tools are unhappy with 
unicode...
+RHOMES = map( lambda x: x.encode('ascii'), RHOMES )
+
 # On windows, check for/create the python link library 
 #if sys.platform=="win32":
 #rpy_wintools.CreatePythonWinLib()


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [382] trunk/rpy/rpy.py

2007-11-29 Thread warnes
Revision: 382
  http://rpy.svn.sourceforge.net/rpy/?rev=382&view=rev
Author:   warnes
Date: 2007-11-29 08:07:13 -0800 (Thu, 29 Nov 2007)

Log Message:
---
Move rpy module load back inside try:except block

Modified Paths:
--
trunk/rpy/rpy.py

Modified: trunk/rpy/rpy.py
===
--- trunk/rpy/rpy.py2007-11-29 16:06:18 UTC (rev 381)
+++ trunk/rpy/rpy.py2007-11-29 16:07:13 UTC (rev 382)
@@ -114,12 +114,14 @@
 print "Loading Rpy version %s .." % RVER,
 sys.stdout.flush()
 
-exec("import _rpy%s as _rpy" % RVER)
+
 try:
-  pass
-except:
-  #raise RuntimeError(
-  print(
+  command = "import _rpy%s as _rpy" % RVER
+  print "Executing the command %s..." % command
+  exec(command)
+  print "Done."
+except Exception, e:
+  raise RuntimeError( str(e) + 
   """
 
   RPy module can not be imported. Please check if your rpy
@@ -132,7 +134,6 @@
   >>> from rpy import *
   
   """ % RVERSION)
-  sys.exit(1)
 
 if VERBOSE:
 print "Done."


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [383] trunk/rpy

2007-11-29 Thread warnes
Revision: 383
  http://rpy.svn.sourceforge.net/rpy/?rev=383&view=rev
Author:   warnes
Date: 2007-11-29 08:12:07 -0800 (Thu, 29 Nov 2007)

Log Message:
---
Update windows compile instructions and batch file

Modified Paths:
--
trunk/rpy/INSTALL.WINDOWS
trunk/rpy/setup.bat

Modified: trunk/rpy/INSTALL.WINDOWS
===
--- trunk/rpy/INSTALL.WINDOWS   2007-11-29 16:07:13 UTC (rev 382)
+++ trunk/rpy/INSTALL.WINDOWS   2007-11-29 16:12:07 UTC (rev 383)
@@ -11,13 +11,11 @@
 
 o R (a recent version)
 
-o The "Numeric" python module.
+o Either the "NumPy" or  "Numeric" python module.
 
   Main page: http://numpy.sf.net/
   Download from:
-  
http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=1351)
-  
-  Note: You need the "Numeric" module and *not* "NumPy".
+  http://sourceforge.net/project/showfiles.php?group_id=1369
 
 o win32all, windows extensions from Mark Hammond (included in
   ActiveState python) and is also available from
@@ -43,4 +41,4 @@
where you installed MinGW.
 
 3. Run setup.bat
-
\ No newline at end of file
+

Modified: trunk/rpy/setup.bat
===
--- trunk/rpy/setup.bat 2007-11-29 16:07:13 UTC (rev 382)
+++ trunk/rpy/setup.bat 2007-11-29 16:12:07 UTC (rev 383)
@@ -39,9 +39,9 @@
 
 REM Important Paths
 set MINGW=C:\MinGW
-set PYTHON=C:\Python24
+set PYTHON=C:\Python25
 
-path %MINGW%\bin;%PYTHON%
+path %MINGW%\bin;%PYTHON%;%PATH%
 
 echo copying setup.Win32 to setup.cfg
 copy setup.Win32 setup.cfg
@@ -50,10 +50,17 @@
 REM set RHOMES=C:\Progra~1\R\R-2.2.1
 
 REM Uncomment to clean up completely before starting
-REM python setup.py build clean --all
+python setup.py build clean --all
 
 REM Perform Local Install
 python setup.py build_ext --compiler=mingw32 build install --force
 
 REM Create Windows Installer
 python setup.py build --compiler=mingw32 bdist_wininst
+
+REM Finish batch file, but don't close the window.  This allows
+REM the user to see any messages that were generated, it also
+REM leaves the shell with the environment variables as we set
+REM them, making it easier for users to perform other actions
+REM in an appropriate environment
+EXIT /B


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [389] trunk/rpy/rpy_version.py

2007-11-29 Thread warnes
Revision: 389
  http://rpy.svn.sourceforge.net/rpy/?rev=389&view=rev
Author:   warnes
Date: 2007-11-29 17:27:58 -0800 (Thu, 29 Nov 2007)

Log Message:
---
Update version to 1.0.1

Modified Paths:
--
trunk/rpy/rpy_version.py

Modified: trunk/rpy/rpy_version.py
===
--- trunk/rpy/rpy_version.py2007-11-30 01:00:00 UTC (rev 388)
+++ trunk/rpy/rpy_version.py2007-11-30 01:27:58 UTC (rev 389)
@@ -1 +1 @@
-rpy_version = "1.0.0"
+rpy_version = "1.0.1"


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [388] trunk/rpy/doc

2007-11-29 Thread warnes
Revision: 388
  http://rpy.svn.sourceforge.net/rpy/?rev=388&view=rev
Author:   warnes
Date: 2007-11-29 17:00:00 -0800 (Thu, 29 Nov 2007)

Log Message:
---
Update copyright notice in documentation

Modified Paths:
--
trunk/rpy/doc/defs.texi
trunk/rpy/doc/rpy.texi

Modified: trunk/rpy/doc/defs.texi
===
--- trunk/rpy/doc/defs.texi 2007-11-30 00:57:41 UTC (rev 387)
+++ trunk/rpy/doc/defs.texi 2007-11-30 01:00:00 UTC (rev 388)
@@ -1,3 +1,4 @@
[EMAIL PROTECTED]
 %  $Id$
 %
 % * BEGIN LICENSE BLOCK *
@@ -35,6 +36,7 @@
 % the terms of any one of the MPL, the GPL or the LGPL.
 %
 % * END LICENSE BLOCK *
[EMAIL PROTECTED] ignore
 
 @macro Python
 Python

Modified: trunk/rpy/doc/rpy.texi
===
--- trunk/rpy/doc/rpy.texi  2007-11-30 00:57:41 UTC (rev 387)
+++ trunk/rpy/doc/rpy.texi  2007-11-30 01:00:00 UTC (rev 388)
@@ -1,42 +1,5 @@
-%  $Id$
-%
-% * BEGIN LICENSE BLOCK *
-% Version: MPL 1.1/GPL 2.0/LGPL 2.1
-%
-% The contents of this file are subject to the Mozilla Public License Version
-% 1.1 (the "License"); you may not use this file except in compliance with
-% the License. You may obtain a copy of the License at
-% http://www.mozilla.org/MPL/
-%
-% Software distributed under the License is distributed on an "AS IS" basis,
-% WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-% for the specific language governing rights and limitations under the
-% License.
-%
-% The Original Code is the RPy python module.
-%
-% The Initial Developer of the Original Code is Walter Moreira.
-% Portions created by the Initial Developer are Copyright (C) 2002
-% the Initial Developer. All Rights Reserved.
-%
-% Contributor(s):
-%Gregory R. Warnes  (Maintainer)
-%
-% Alternatively, the contents of this file may be used under the terms of
-% either the GNU General Public License Version 2 or later (the "GPL"), or
-% the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-% in which case the provisions of the GPL or the LGPL are applicable instead
-% of those above. If you wish to allow use of your version of this file only
-% under the terms of either the GPL or the LGPL, and not to allow others to
-% use your version of this file under the terms of the MPL, indicate your
-% decision by deleting the provisions above and replace them with the notice
-% and other provisions required by the GPL or the LGPL. If you do not delete
-% the provisions above, a recipient may use your version of this file under
-% the terms of any one of the MPL, the GPL or the LGPL.
-%
-% * END LICENSE BLOCK *
-
 \input texinfo  @c -*-texinfo-*-
+
 @c %**start of header
 @setfilename rpy.info
 @include defs.texi
@@ -55,7 +18,8 @@
 This file documents @RPy{} @version{}
 
 Copyright 2002-2004 Walter Moreira
-Copyright 2004- Walter Moriera and Pfizer, Inc.
+Copyright 2004-2006 Walter Moriera and Pfizer, Inc.
+Copyright 2006- Walter Moriera, Pfizer, Inc., University of Rochester 
 
 Permission is granted to make and distribute verbatim
 copies of this manual provided the copyright notice and


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [385] trunk/rpy/setup.bat

2007-11-29 Thread warnes
Revision: 385
  http://rpy.svn.sourceforge.net/rpy/?rev=385&view=rev
Author:   warnes
Date: 2007-11-29 16:55:28 -0800 (Thu, 29 Nov 2007)

Log Message:
---
Improve Win32 setup.bat build script

Modified Paths:
--
trunk/rpy/setup.bat

Modified: trunk/rpy/setup.bat
===
--- trunk/rpy/setup.bat 2007-11-30 00:40:17 UTC (rev 384)
+++ trunk/rpy/setup.bat 2007-11-30 00:55:28 UTC (rev 385)
@@ -52,15 +52,19 @@
 REM Uncomment to clean up completely before starting
 python setup.py build clean --all
 
-REM Perform Local Install
-python setup.py build_ext --compiler=mingw32 build install --force
+REM Perform Local Build and Install
+python setup.py build_ext --compiler=mingw32 install --force
 
 REM Create Windows Installer
 python setup.py build --compiler=mingw32 bdist_wininst
 
-REM Finish batch file, but don't close the window.  This allows
-REM the user to see any messages that were generated, it also
-REM leaves the shell with the environment variables as we set
-REM them, making it easier for users to perform other actions
-REM in an appropriate environment
-EXIT /B
+echo Removing setup.cfg
+del setup.cfg
+
+REM Start a new command shell.  This accomplishes several things:
+REM (1) prevents the window from closing, thus allowing the user
+REM to see any messages that were generated, it also
+REM (2) Leaves the user in a shell with the environment variables 
+REM as we set them, making it easier for users to perform other
+REM actions in an appropriate environment
+cmd /F:ON


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [384] trunk/rpy/src

2007-11-29 Thread warnes
Revision: 384
  http://rpy.svn.sourceforge.net/rpy/?rev=384&view=rev
Author:   warnes
Date: 2007-11-29 16:40:17 -0800 (Thu, 29 Nov 2007)

Log Message:
---
Add appropriate cleanup shell command for Win32

Modified Paths:
--
trunk/rpy/src/RPy.h
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/RPy.h
===
--- trunk/rpy/src/RPy.h 2007-11-29 16:12:07 UTC (rev 383)
+++ trunk/rpy/src/RPy.h 2007-11-30 00:40:17 UTC (rev 384)
@@ -80,7 +80,7 @@
 /* Missing definitions from Rinterface.h or RStartup.h */
 # define CleanEd   Rf_CleanEd
 extern void CleanEd(void);
-extern int R_CollectWarnings; 
+extern int  R_CollectWarnings; 
 # define PrintWarnings Rf_PrintWarnings
 extern void PrintWarnings(void);
 //

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2007-11-29 16:12:07 UTC (rev 383)
+++ trunk/rpy/src/rpymodule.c   2007-11-30 00:40:17 UTC (rev 384)
@@ -1691,8 +1691,14 @@
 CleanEd();  
 KillAllDevices();   
 if((tmpdir = getenv("R_SESSION_TMPDIR"))) {  
-  snprintf((char *)buf, 1024, "rm -rf %s", tmpdir); 
-  R_system((char *)buf);
+
+#ifdef _WIN32
+  snprintf((char *)buf, 1024, "rmdir /S /Q %s", tmpdir); 
+#else
+  snprintf((char *)buf, 1024, "rm -rf %s", tmpdir);
+#endif
+
+  R_system((char *)buf);
 }
 
 PrintWarnings();   /* from device close and .Last */
@@ -1842,7 +1848,7 @@
   /* run as "interactive", so server won't be killed after an error */
   Rp->R_Slave = Rp->R_Verbose = 0;
   Rp->R_Interactive = TRUE;
-  Rp->RestoreAction = SA_RESTORE; /* no restore */
+  Rp->RestoreAction = SA_NORESTORE; /* no restore */
   Rp->SaveAction= SA_NOSAVE;  /* no save */
   
 #if R_VERSION < 0x2   // pre-R-2.0.0
@@ -1973,15 +1979,13 @@
   // I/O routines
   init_io_routines();
 
-
-
   rpy = PyImport_ImportModule("rpy");
   rpy_dict = PyModule_GetDict(rpy);
   //  r_lock = PyDict_GetItemString(rpy_dict, "_r_lock");
   //  PyObject_Print(r_lock, stderr, Py_PRINT_RAW);
   r_lock = NULL;
 
-  if( Py_AtExit(   r_finalize ) )
+  if( Py_AtExit( r_finalize ) )
 {
   fprintf(stderr, "Warning: Unable to set R finalizer.");
   fflush(stderr);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [386] trunk/rpy/rpy_wintools.py

2007-11-29 Thread warnes
Revision: 386
  http://rpy.svn.sourceforge.net/rpy/?rev=386&view=rev
Author:   warnes
Date: 2007-11-29 16:56:31 -0800 (Thu, 29 Nov 2007)

Log Message:
---
Improve detection of R installation directories on Win32

Modified Paths:
--
trunk/rpy/rpy_wintools.py

Modified: trunk/rpy/rpy_wintools.py
===
--- trunk/rpy/rpy_wintools.py   2007-11-30 00:55:28 UTC (rev 385)
+++ trunk/rpy/rpy_wintools.py   2007-11-30 00:56:31 UTC (rev 386)
@@ -4,19 +4,43 @@
 import os, os.path, sys, shutil
 import rpy_tools
 
+
 def get_RHOMES():
+
+# Standard R
+Rhomes = get_RHOMES_inner("R")
+
+# RStat, commercially packaged R from Random Technologies LLC
+Rhomes.extend( get_RHOMES_inner("RStat") )
+   
+if os.environ.get('RHOME', None):
+Rhomes.insert(0, os.environ.get('RHOME', None))
+
+return Rhomes
+
+def get_RHOMES_inner(progname="R"):
 from win32com.shell import shell, shellcon
 program_files = shell.SHGetFolderPath(0,
   shellcon.CSIDL_PROGRAM_FILES,
   0,
   0)
-Rdir = os.path.join(program_files,"R")
+
+Rdir = os.path.join(program_files, progname)
 Rhomes = []
 if os.path.exists(Rdir):
-Rprogs = os.listdir(Rdir)
-Rhomes = map( lambda(x): os.path.join(Rdir, x), Rprogs)
-if os.environ.get('RHOME', None):
-Rhomes.insert(0, os.environ.get('RHOME', None))
+RVersionDirs = os.listdir(Rdir)
+for thisRVersionDir in RVersionDirs:
+  BasePath = os.path.join(Rdir, thisRVersionDir)
+  DLLPath1 = os.path.join(BasePath, "bin", "R.dll" )
+  DLLPath2 = os.path.join(BasePath, "lib", "R.dll" )
+  if os.path.exists(DLLPath1) or os.path.exists(DLLPath2):
+ Rhomes.append(  BasePath )
+
 return Rhomes
 
-
+if __name__ == '__main__':
+  RHomes = get_RHOMES()
+  print "Found", len(RHomes), " R Installations:"
+  for path in RHomes:
+ print "", path
+  print


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [387] trunk/rpy/rpy.py

2007-11-29 Thread warnes
Revision: 387
  http://rpy.svn.sourceforge.net/rpy/?rev=387&view=rev
Author:   warnes
Date: 2007-11-29 16:57:41 -0800 (Thu, 29 Nov 2007)

Log Message:
---
Remove debug print statments

Modified Paths:
--
trunk/rpy/rpy.py

Modified: trunk/rpy/rpy.py
===
--- trunk/rpy/rpy.py2007-11-30 00:56:31 UTC (rev 386)
+++ trunk/rpy/rpy.py2007-11-30 00:57:41 UTC (rev 387)
@@ -117,9 +117,7 @@
 
 try:
   command = "import _rpy%s as _rpy" % RVER
-  print "Executing the command %s..." % command
   exec(command)
-  print "Done."
 except Exception, e:
   raise RuntimeError( str(e) + 
   """


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [390] trunk/rpy/NEWS

2007-11-29 Thread warnes
Revision: 390
  http://rpy.svn.sourceforge.net/rpy/?rev=390&view=rev
Author:   warnes
Date: 2007-11-29 17:44:49 -0800 (Thu, 29 Nov 2007)

Log Message:
---
Update NEWS for 1.0.1

Modified Paths:
--
trunk/rpy/NEWS

Modified: trunk/rpy/NEWS
===
--- trunk/rpy/NEWS  2007-11-30 01:27:58 UTC (rev 389)
+++ trunk/rpy/NEWS  2007-11-30 01:44:49 UTC (rev 390)
@@ -1,3 +1,13 @@
+CHANGES IN RPY 1.0.1 - 2007-11-29
+-
+
+Bug Fixes:
+
+  - Correct silent termination on load on MS-Windows (really this time!)
+
+  - Improve detection of installed R versions during build process 
+on MS-Windows
+
 CHANGES IN RPY 1.0.0 - 2007-11-15
 -
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [391] trunk/rpy

2008-01-02 Thread warnes
Revision: 391
  http://rpy.svn.sourceforge.net/rpy/?rev=391&view=rev
Author:   warnes
Date: 2008-01-02 09:29:55 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Add startup options to prevent initialization of console read/write/showfiles

Modified Paths:
--
trunk/rpy/rpy.py
trunk/rpy/rpy_options.py

Modified: trunk/rpy/rpy.py
===
--- trunk/rpy/rpy.py2007-11-30 01:44:49 UTC (rev 390)
+++ trunk/rpy/rpy.py2008-01-02 17:29:55 UTC (rev 391)
@@ -194,11 +194,22 @@
 get_rpy_showfiles = _rpy.get_showfiles
 
 # Default I/O to functions in the 'rpy_io' module
-set_rpy_output(rpy_io.rpy_output)
-set_rpy_input(rpy_io.rpy_input)
-if sys.platform != 'win32':
-set_rpy_showfiles(rpy_io.rpy_showfiles)
+if rpy_options['SETUP_WRITE_CONSOLE']:
+set_rpy_output(rpy_io.rpy_output)
+else:
+print "\nSkipping initialization of R console *write* support.\n"
 
+if rpy_options['SETUP_READ_CONSOLE']:
+set_rpy_input(rpy_io.rpy_input)
+else:
+print "\nSkipping initialization of R console *read* support.\n"
+
+if rpy_options['SETUP_SHOWFILES']:
+if sys.platform != 'win32':
+set_rpy_showfiles(rpy_io.rpy_showfiles)
+else:
+print "\nSkipping initialization of R console *file viewer* support\n"
+
 # Functions for processing events
 import threading
 

Modified: trunk/rpy/rpy_options.py
===
--- trunk/rpy/rpy_options.py2007-11-30 01:44:49 UTC (rev 390)
+++ trunk/rpy/rpy_options.py2008-01-02 17:29:55 UTC (rev 391)
@@ -28,14 +28,23 @@
   'RVER':None,# R Version *number*
   'RUSER':None,   # R User's Home Directory
   'USE_NUMERIC':None, # Is Numeric module available
-  'VERBOSE':False  # Should status messages be displated.
+  'VERBOSE':False,  # Should status messages be displated.
+  'SETUP_READ_CONSOLE':  True,  # Set to False to prevent standard console 
read config
+  'SETUP_WRITE_CONSOLE': True,  # Set to False to prevent standard console 
write config
+  'SETUP_SHOWFILES': True   # Set to False to prevent standard console 
file viewerd config
   }
 
-def set_options(RHOME=None, USE_NUMERIC=None, VERBOSE=None):
+def set_options(RHOME=None, USE_NUMERIC=None, VERBOSE=None, 
SETUP_READ_CONSOLE=None, SETUP_WRITE_CONSOLE=None, SETUP_SHOWFILES=None):
   if RHOME != None and os.path.isdir(RHOME):
 rpy_options['RHOME'] = RHOME
   if USE_NUMERIC != None and USE_NUMERIC in [True, False]:
 rpy_options['USE_NUMERIC'] = USE_NUMERIC
   if VERBOSE != None and VERBOSE in [True, False]:
 rpy_options['VERBOSE'] = VERBOSE
+  if SETUP_READ_CONSOLE != None and SETUP_READ_CONSOLE in [True, False]:
+rpy_options['SETUP_READ_CONSOLE'] = VERBOSE
+  if SETUP_WRITE_CONSOLE != None and SETUP_WRITE_CONSOLE in [True, False]:
+rpy_options['SETUP_WRITE_CONSOLE'] = VERBOSE
+  if SETUP_SHOWFILES != None and SETUP_SHOWFILES in [True, False]:
+rpy_options['SETUP_SHOWFILES'] = VERBOSE
   


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [392] trunk/rpy/rpy_tools.py

2008-01-02 Thread warnes
Revision: 392
  http://rpy.svn.sourceforge.net/rpy/?rev=392&view=rev
Author:   warnes
Date: 2008-01-02 09:33:42 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Use 'tail -n 1' instead of 'tail -1' when calling 'R RHOME' to make recent 
versions of tail happy

Modified Paths:
--
trunk/rpy/rpy_tools.py

Modified: trunk/rpy/rpy_tools.py
===
--- trunk/rpy/rpy_tools.py  2008-01-02 17:29:55 UTC (rev 391)
+++ trunk/rpy/rpy_tools.py  2008-01-02 17:33:42 UTC (rev 392)
@@ -53,7 +53,7 @@
 if sys.platform == 'win32':
   stat, rhome = getstatusoutput('R RHOME')
 else:
-  stat, rhome = getstatusoutput('R RHOME | tail -1')
+  stat, rhome = getstatusoutput('R RHOME | tail -n 1')
 if stat or len(rhome)<=0:
   raise RuntimeExecError("Couldn't execute the R interpreter.\n"
  "Check whether R is in the execution path.")


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [393] trunk/rpy/src/io.c

2008-01-02 Thread warnes
Revision: 393
  http://rpy.svn.sourceforge.net/rpy/?rev=393&view=rev
Author:   warnes
Date: 2008-01-02 09:34:28 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Minor code reformatting in io.c

Modified Paths:
--
trunk/rpy/src/io.c

Modified: trunk/rpy/src/io.c
===
--- trunk/rpy/src/io.c  2008-01-02 17:33:42 UTC (rev 392)
+++ trunk/rpy/src/io.c  2008-01-02 17:34:28 UTC (rev 393)
@@ -98,12 +98,14 @@
 int
 RPy_ReadConsole(char *prompt, 
 char *buf, 
-int len, int addtohistory)
+int len, 
+   int addtohistory)
 #else
 int
 RPy_ReadConsole(char *prompt, 
 unsigned char *buf, 
-int len, int addtohistory)
+int len, 
+   int addtohistory)
 #endif
 {
   PyObject *input_data;
@@ -258,7 +260,9 @@
 void
 init_io_routines(void)
 #ifdef _WIN32
-{ return; }
+{ 
+  return; 
+}
 #else
 {
   R_Outputfile = NULL;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [394] trunk/rpy

2008-01-02 Thread warnes
Revision: 394
  http://rpy.svn.sourceforge.net/rpy/?rev=394&view=rev
Author:   warnes
Date: 2008-01-02 09:57:04 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Add code to export 'Robj' type

Modified Paths:
--
trunk/rpy/rpy.py
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/rpy.py
===
--- trunk/rpy/rpy.py2008-01-02 17:34:28 UTC (rev 393)
+++ trunk/rpy/rpy.py2008-01-02 17:57:04 UTC (rev 394)
@@ -181,6 +181,7 @@
 # for backwards compatibility
 RException = RPyException
 
+Robj = _rpy.Robj
 
 
 # I/O setters

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2008-01-02 17:34:28 UTC (rev 393)
+++ trunk/rpy/src/rpymodule.c   2008-01-02 17:57:04 UTC (rev 394)
@@ -1899,7 +1899,16 @@
   Robj_Type.tp_alloc = PyType_GenericAlloc;
 #endif
 
-  m = Py_InitModule(xstr(RPY_SHNAME), rpy_methods);
+  /* Initialize the module with its content */
+  if (PyType_Ready(&Robj_Type) < 0)
+return;
+  m = Py_InitModule3(xstr(RPY_SHNAME), 
+rpy_methods,
+"Python interface to the R Programming Language");
+  Py_INCREF(&Robj_Type);
+  PyModule_AddObject(m, Robj_Type.tp_name, 
+(PyObject *)&Robj_Type);
+
   d = PyModule_GetDict(m);
 
   /* Save this interpreter */


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [395] trunk/rpy/tests/test_sigint.py

2008-01-07 Thread warnes
Revision: 395
  http://rpy.svn.sourceforge.net/rpy/?rev=395&view=rev
Author:   warnes
Date: 2008-01-07 08:01:22 -0800 (Mon, 07 Jan 2008)

Log Message:
---
Add 1 second sleep to interrupt test to allow time for interrupt delivery

Modified Paths:
--
trunk/rpy/tests/test_sigint.py

Modified: trunk/rpy/tests/test_sigint.py
===
--- trunk/rpy/tests/test_sigint.py  2008-01-02 17:57:04 UTC (rev 394)
+++ trunk/rpy/tests/test_sigint.py  2008-01-07 16:01:22 UTC (rev 395)
@@ -7,6 +7,7 @@
 import sys
 import os
 import signal
+import time
 
 
 def sendsig():
@@ -15,6 +16,7 @@
 raise KeyboardInterrupt
 else:
 os.kill(os.getpid(), signal.SIGINT)
+time.sleep(1)
 
 class SigintTestCase(unittest.TestCase):
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [396] trunk/rpy/src/rpymodule.c

2008-01-07 Thread warnes
Revision: 396
  http://rpy.svn.sourceforge.net/rpy/?rev=396&view=rev
Author:   warnes
Date: 2008-01-07 08:03:16 -0800 (Mon, 07 Jan 2008)

Log Message:
---
Add ability to pass command-line argumnents to init_embedded_win32

Modified Paths:
--
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2008-01-07 16:01:22 UTC (rev 395)
+++ trunk/rpy/src/rpymodule.c   2008-01-07 16:03:16 UTC (rev 396)
@@ -82,6 +82,8 @@
 static char RVERSION[BUFSIZ];
 static char RVER[BUFSIZ];
 static char RUSER[BUFSIZ];
+char *defaultargv[] = {"rpy", "-q", "--vanilla"};
+int  defaultargc = sizeof(defaultargv) / sizeof(defaultargv[0]);
 
 /* Global interpreter */
 PyInterpreterState *my_interp;
@@ -1803,7 +1805,9 @@
 
 /* initialise embedded R; based on rproxy_impl.c from the R distribution */
 static void
-init_embedded_win32( void ) {
+init_embedded_win32(int argc, 
+   char *argv[])
+{
   structRstart rp;
   Rstart Rp = &rp;
   char Rversion[25];
@@ -1856,7 +1860,7 @@
   Rp->CommandLineArgs = NULL;
   Rp->NumCommandLineArgs = 0;
 #else
-  R_set_command_line_arguments(0, NULL);
+  R_set_command_line_arguments(argc, argv);
 #endif
   R_SetParams(Rp); /* so R_ShowMessage is set */
   R_SizeFromEnv(Rp);
@@ -1875,7 +1879,6 @@
   PyObject *m, *d;
   PyOS_sighandler_t old_int;
 #ifndef _WIN32
-  char *defaultargv[] = {"rpy", "-q", "--vanilla"};
   PyOS_sighandler_t old_usr1, old_usr2;
 #endif
   SEXP interact;
@@ -1925,10 +1928,11 @@
 #endif
 
 #ifdef _WIN32
-  init_embedded_win32();
+  init_embedded_win32(defaultargc,
+ defaultargv);
 #else
-  Rf_initEmbeddedR( sizeof(defaultargv) / sizeof(defaultargv[0]),
-defaultargv);
+  Rf_initEmbeddedR(defaultargc,
+   defaultargv);
 #endif
 
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [397] trunk/rpy/src/rpymodule.c

2008-01-07 Thread warnes
Revision: 397
  http://rpy.svn.sourceforge.net/rpy/?rev=397&view=rev
Author:   warnes
Date: 2008-01-07 09:16:11 -0800 (Mon, 07 Jan 2008)

Log Message:
---
Correct mismatch between declaration and definition of init_embedded_win32

Modified Paths:
--
trunk/rpy/src/rpymodule.c

Modified: trunk/rpy/src/rpymodule.c
===
--- trunk/rpy/src/rpymodule.c   2008-01-07 16:03:16 UTC (rev 396)
+++ trunk/rpy/src/rpymodule.c   2008-01-07 17:16:11 UTC (rev 397)
@@ -62,7 +62,7 @@
 static PyObject *r_cleanup(void); /* Clean up R & release resources */
 
 #ifdef _WIN32
-static void init_embedded_win32( void );
+static void init_embedded_win32(int argc, char *argv[]);
 #endif
 
 /* Global objects */


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] SF.net SVN: rpy: [401] trunk/rpy/rpy_tools.py

2008-01-25 Thread warnes
Revision: 401
  http://rpy.svn.sourceforge.net/rpy/?rev=401&view=rev
Author:   warnes
Date: 2008-01-25 12:14:00 -0800 (Fri, 25 Jan 2008)

Log Message:
---
Correct name of runtime exception

Modified Paths:
--
trunk/rpy/rpy_tools.py

Modified: trunk/rpy/rpy_tools.py
===
--- trunk/rpy/rpy_tools.py  2008-01-21 16:08:51 UTC (rev 400)
+++ trunk/rpy/rpy_tools.py  2008-01-25 20:14:00 UTC (rev 401)
@@ -55,7 +55,7 @@
 else:
   stat, rhome = getstatusoutput('R RHOME | tail -n 1')
 if stat or len(rhome)<=0:
-  raise RuntimeExecError("Couldn't execute the R interpreter.\n"
+  raise RuntimeError("Couldn't execute the R interpreter.\n"
  "Check whether R is in the execution path.")
 
   rhome = rhome.strip()


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] r.predict()

2008-02-22 Thread Gregory Warnes

The basic problem is that by default, RPy converts objects returned  
to python to a python object.  Unfortunately, this conversion loses  
some information, including the type of the original R object.

To avoid this conversion add two lines to your code:


On Feb 22, 2008, at 12:36PM , marco hofmann wrote:

> Hi all,
> I have a problem with the predict command. Here is an example:
>
> from rpy import *

# avoid automatic conversion
set_default_mode(NO_CONVERSION)

> r.library("nnet")
> model = r("Fxy~x+y")
>
> df = r.data_frame(x = r.c(0,2,5,10,15)
>,y = r.c(0,2,5,8,10)
>,Fxy = r.c(0,2,5,8,10))
>
> NNModel = r.nnet(model, data = df
>   , size =10, decay =1e-3
>   , lineout=True, skip=True
>   , maxit=1000, Hess =True)
>
> XG = r.expand_grid(x = r.seq(0,7,1), y = r.seq(0,7,1))
> x = r.seq(0,7,1)
> y = r.seq(0,7,1)
>
> fit = r.predict(NNModel,XG)


# turn automatic conversion back on
set_default_mode(BASIC_CONVERSION)

fit = r.predict(NNModel,XG)
print fit



-Greg


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] package : survival

2008-02-28 Thread Gregory Warnes


The basic problem is that "survfit" is using deparse() to try to get  
the name of the Surv() object so it can generate an R formula.   
Unfortunately, this object doesn't have a name in R's namespace, so  
deparse() gets the structure representation instead of the name, and  
then things fail.


As a consequence, this is one of the cases when you need to  
explicitly place your  objects into R's own namespace, and then ask  
R's own parser to work on the command string.  This code shows how to  
accomplish this:



from rpy import *
r.library("survival")
set_default_mode(NO_CONVERSION)
d=r.rep(1,41)
t=r.c( r.rep(6,5), r.rep(9,3) , r.rep(12,24), r.rep(15,9) )

## Put the 't' and 'd' objects into R's namespace
r.assign("t",t)
r.assign("d",d)

## Use R's interpreter to execute the necessary code
sf = r("survfit(Surv(t,d))")

## Now we can examine the resulting object:
r.print_(sf)

## or display it
r.plot(sf)


I hope this helps,

-Greg


On Feb 27, 2008, at 6:07AM , Lore Merdrignac wrote:


Thanks for answering.
I had already tested to split the expression but there is still a  
problem with the function survfit(). Nevertheless this expression  
works with R, but I have to implement it with python. Indeed, I am  
trying to create a software for survival analysis using python  
language...


>>> s=r.Surv(t,d)
>>> ss=r.survfit(s)
Traceback (most recent call last):
  File "", line 1, in ?
RPy_RException: Erreur dans parse(text = paste(deparse(call[[2]]),  
1, sep = "~")) :

  unexpected numeric constant dans :
"structure(c(6L, 6L, 6L, 6L, 6L, 9L, 9L, 9L, 12L, 12L, 12L, 12L, ~1
12L"

and obviously, I get then :

>>> survPlot = r.get("plot.survfit", envir=r.getNamespace("survival"))
>>> survPlot(sf)
Traceback (most recent call last):
  File "", line 1, in ?
NameError: name 'sf' is not defined

Lore.

> Date: Wed, 27 Feb 2008 11:48:12 +0100
> From: [EMAIL PROTECTED]
> To: rpy-list@lists.sourceforge.net
> Subject: Re: [Rpy] package : survival
>
> 2008/2/27, Lore Merdrignac <[EMAIL PROTECTED]>:
> >
> > Hi,
> > I have already posted a first problem of "NO_CONVERSION" with  
the package
> > SURVIVAL. But I still have a problem by using the function  
survfit() of the

> > package.
> > Here is the code :
> >
> > >>> from rpy import *
> > >>> r.library("survival")
> > >>> set_default_mode(NO_CONVERSION)
> > >>> d=r.rep(1,41)
> > >>> t=r.c( r.rep(6,5), r.rep(9,3) , r.rep(12,24), r.rep(15,9) )
> > >>> r.plot(r.survfit(r.Surv(t,d)))
> > Traceback (most recent call last):
> > File "", line 1, in ?
> > RPy_RException: Erreur dans parse(text = paste(deparse(call 
[[2]]), 1, sep =

> > "~")) :
> > unexpected numeric constant dans :
> > "structure(c(6L, 6L, 6L, 6L, 6L, 9L, 9L, 9L, 12L, 12L, 12L,  
12L, ~1

> > 12L"
> >
> > Is there anything I am doing wrong ? I really need this  
function to
> > complete my survival analysis... I would really appreciate if  
anyone could

> > help me.
>
> I guess that an emergency solution is to be doing the whole  
analysis in R.

>
> Otherwise, you could try splitting up a bit your expression
> r.plot(r.survfit(r.Surv(t,d)))
> to see better were things are going wrong:
> s = r.Surv(t,d)
> sf = r.survfit(s)
> plot(sf)
>
> The following has a chance to work (not tested):
> survPlot = r.get("plot.survfit", envir=r.getNamespace("survival"))
> survPlot(sf)
>
>
> L.
>
> PS: An alternative to the NO_CONVERSION business might be coming  
in not-so-long.

>
>
> > Thanks.
> >
> > Lore.
> >
> > 
> > Windows Live Messenger 2008 vient de sortir, découvrez son  
nouveau design !

> > Téléchargez gratuitement Messenger 2008
> >  
-- 
---

> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> > ___
> > rpy-list mailing list
> > rpy-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/rpy-list
> >
> >
>
>  
-- 
---

> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> ___
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list


Windows Live Messenger 2008 vient de sortir, entièrement  
personnalisable ! Téléchargez gratuitement Messenger 2008
-- 
---

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/attachment.txt>


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008

Re: [Rpy] Rpy handling kmeans

2008-02-28 Thread Gregory Warnes

Hello Ding,

It appears that either you don't have numpy properly installed, or  
that your copy of rpy was compiled without numpy support.

A simple workaround for this specific case would be to turn of  
conversion of r to python objects, so that the object 'x' remains an  
r matrix, rather than being converted into a python list object (if  
numpy was being properly used, the return object would be a numpy  
matrix).

Try this code:

from rpy import *
set_default_mode(NO_CONVERSION)
x = r.matrix(r.rnorm(100), 50, 2)

# returned as an R object
km_1 = r.kmeans(x, 2)
r.print_(km_1)

# returned and converted to a python object
set_default_mode(BASIC_CONVERSION)
km_2 = r.kmeans(x, 2)
print km_2

-Greg

On Feb 22, 2008, at 5:40PM , Ding Zhou wrote:

> Hi,
>
> I was trying get the rpy to work but was stuck. Would you help us with
> these simple rpy commands?
>
> I did the following:
>
> python
>
> from rpy import r
>
> x = r.matrix(r.rnorm(100), 50, 2)
>
> r.kmeans(x, 2)
>
> The error was:
>
> Traceback (most recent call last):
>   File "", line 1, in ?
> rpy.RException: Error in as.double.default(x) : (list) object  
> cannot be
> coerced to 'double'
>
> I also tried:
>
> x = numpy.array(x) before r.kmeans but it didn't work.
>
> I was able to run the same thing in R by doing:
>
> x = matrix(rnorm(100), 50, 2)
> kmeans(x, 2)
>
> But the test with rpy failed miserably ... Any idea to help out?
>
> Thanks,
> -Ding.
>
> -- 
> ---
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> ___
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] rpy crashes on graphics

2008-02-28 Thread Gregory Warnes

This bug should be corrected in the latest version of rpy.  What  
version are you using?

-G

On Feb 28, 2008, at 10:39AM , Wacek Kusnierczyk wrote:

> Hi,
>
> Having used rpy for just a while on Fedora 7, python 2.5, I discover
> that it crashes on graphics functions such as plot, hist, etc.
>
> This simple code:
>
> r.plot(range(1000))
>
> causes python to exit (not on all occasions, though) with this  
> message:
>
> Error during wrapup: C stack usage is too close to the limit
> *** stack smashing detected ***: python terminated
> Aborted
>
> Is it a bug, or an installation problem?
>
> Otherwise, rpy is a great package.
>
> Thanks,
> vQ
>
> -- 
> ---
> Wacek Kusnierczyk, MD MSc
>
> Email: [EMAIL PROTECTED]
> Phone: +47 73591875
>
> Department of Information and Computer Science (IDI)
> Faculty of Information Technology, Mathematics and Electrical  
> Engineering (IME)
> Norwegian University of Science and Technology (NTNU)
> Sem Saelands vei 7, 7491 Trondheim, Norway
>
> Bioinformatics & Gene Regulation Group
> Department of Cancer Research and Molecular Medicine (IKM)
> Faculty of Medicine (DMF)
> Norwegian University of Science and Technology (NTNU)
> Laboratory Center, Erling Skjalgsons gt. 1, 7030 Trondheim, Norway
>
> ---
>
>
>
> -- 
> ---
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> ___
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] SF.net SVN: rpy: [411]trunk/sandbox/rpy_nextgen/rinterface/rinterface.c

2008-03-03 Thread Gregory Warnes
Wow, Laurent, you've been doing a lot of work!

On Mar 2, 2008, at 2:52PM , <[EMAIL PROTECTED]>  
<[EMAIL PROTECTED]> wrote:
> (there is something odd going on, with variable names
> at the Python level suddenly pointing to nowhere - and
> this often ends in a segfault :/ )

Probably R is garbage collecting the R object.  Have you implemented  
something like the R_References object used by RPy 1.X to maintain a  
list of R objects?

See the Robj_new and Robj_dealloc functions in src/rpymodule.c for  
hos R_References is used.

-G



-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] read csv in python, and pass it on to R?

2008-04-01 Thread Gregory Warnes

You can pass the read data directly to R.  Probably the best way to  
do this is to construct a python list containing one vector per  
column.  Call as.data.frame() on the list, and then proceed.

For example:


from rpy import *
set_default_mode(NO_CONVERSION)
data = [ [ 1, 2, 3], ["A","B","C"], [1.08, 1.334, 3.12] ]
df = r.as_data_frame(data)
r.print_(df)


-Greg   




On Apr 1, 2008, at 5:40AM , Peter wrote:
> Hi Lukasz,
>
> If your data has all the elements of the same type, then you could try
> loading it into a NumPy matrix or array, and passing that to R.
>
> I personally would pass the filename to R, and use R's read.table()
> command to load it in R.  You can work out the exact options you need
> for read.table() by experimenting in an R session, and then try the
> same from rpy.  This assumes you do not need the actual data in python
> too.
>
> I don't know if you can pass the file pointer (handle) from python to
> R.  I would be interested to know if this is possible.
>
> Peter
>
> On Tue, Apr 1, 2008 at 2:51 AM, Lukasz Szybalski  
> <[EMAIL PROTECTED]> wrote:
>> Hello,
>>  I am trying to read a 100mb+ csv file in python.
>>  f=csv.DictReader(open(filename))
>>  or
>>  f=csv.Reader(open(filename))
>>
>>  When I read it in I would like to pass it to R to do some work on  
>> it.
>>  How would I do that?
>>
>>  Do I pass the file pointer or read file?
>>  I think for speed purposes I would prefer passing read file.
>>
>>  Lucas
>
> -- 
> ---
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/ 
> marketplace
> ___
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] Wiki for RPy Documentation?

2008-04-07 Thread Gregory Warnes

Hi All,

I think it is a good idea to use a Wiki to help develop  
documentation.  I've enabled Wiki support over at sourceforge for rpy at

http://rpy.wiki.sourceforge.net/

but I don't have time to try to pull the existing documentation in  
there.

Of course, patches against the existing documentation are more than  
welcom.

-G



On Mar 31, 2008, at 1:10PM , Peter wrote:
> On Fri, Mar 28, 2008 at 11:19 PM, John Riedl <[EMAIL PROTECTED]> wrote:
>> Hello RPy users!  I'm new to using RPy, but am very enthusiastic  
>> about
>>  my experiences so far.  In the course of my exploration, I've  
>> read the
>>  documentation carefully, and have many errata (most minor; some not)
>>  I'd like to contribute back to the community.  Are there plans to
>>  convert the documentation into a wiki, so we can all participate in
>>  improving it?  I think this would be a substantial advantage to the
>>  community -- and I volunteer to wikify the TeX document if others
>>  agree.
>
> In the short term, I would think patches to any existing documentation
> would be a good idea.  It rather depends on how many people are going
> to be contributing to the docs, and of course if they know LaTeX.  I
> have written up a few rpy examples online as HTML myself, which could
> be merged in...
>
>> From experience in other projects, a wiki worthwhile if you can get a
> good sized group of people involved.  Otherwise it can just get
> spammed and cause more work.
>
> Peter
>
> -- 
> ---
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/ 
> marketplace
> ___
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] change RHOME

2008-04-10 Thread Gregory Warnes


If you explicitly set the RHOME environment variable to point to the  
R 2.4.1 directory, rpy will use that RHOME and hence R 2.4.1.


-Greg


On Apr 10, 2008, at 5:53AM , Eloi Ribeiro wrote:


Dear list,

We are facing the fowling problem. Every thing worked fine while we  
had Python 2.4 + R 2.4.1 + Rpy ($Id: rpy.py 339 2006-08-18  
14:19:22Z alain001 $). After installing R 2.6.2 the RHOME is now  
pointing to R 2.6.2 and we wont to change it back to R 2.4.1 to  
make it work as it was before. We already look at the system PATH  
and it is ok, with R 2.4.1, in fact if we open a console and start  
R the version is 2.4.1. So how can we tell Rpy to use  R version  
2.4.1 again?


PC details:
OS: windows 2000
R versions installed: 2.4.1, 2.5.0 and 2.6.2
Python versions installed: 2.1 and 2.4

Thanks in advance for any help. Regards,

--
Eloi Ribeiro

eloi.ribeiro ARROBA gmail PONTO com
http://eloi-ribeiro.blogspot.com

Spain, Valencia

Antes de imprimir pense que estará a gastar papel, tinta e energia.  
Proteja o ambiente.
-- 
---

This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save  
$100.

Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http:// 
java.sun.com/javaone


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] Error during wrapup: C stack usage is too close to thelimit

2008-04-10 Thread Gregory Warnes


Hi All,

I'm sorry to hear that the C stack limit issue has arisen again.   
I'll check the source code to see if the fix that we put in for RC3  
has gotten removed or disabled somehow.


-Greg


On Apr 9, 2008, at 2:44PM , Laurent Gautier wrote:


I can reproduce it with python-2.5 / R-2.6.1 as well.

The error might well only have to do with X11 devices only, so
I wanted to try R-2.7.0 (since it will/should be using cairo devices
by default), but no luck: I already get error a RunTime error at load
time :-/ .

On the other end, I managed to try the code in the example with a
rewrite of rpy I am working on and R-2.7-alpha: no more crashing on
the C stack, but no refresh on resize (so blank window after
resizing).

Are Microsoft Windows users observing the C stack problem ?


L.

2008/4/9, A_Berger <[EMAIL PROTECTED]>:
>
>  I've been experiencing this error with several versions of rpy.  
The only
>  version that did work properly was Rpy1RC3, however newer  
versions of R
>  require newer versions of Rpy, and I had to update to a newer  
Rpy and
>  survive with the error. I've heard that this issue only arises  
on *nix

>  systems (i.e linux).
>  There are two errors that occur indistinctly when redrawing the X
>  display containing a plot.
>  Here is how it can be reproduced
>
>   
-- 
--

>  ~$ R
>
>  R version 2.5.1 (2007-06-27)
>  Copyright (C) 2007 The R Foundation for Statistical Computing
>  ISBN 3-900051-07-0
>
>  R is free software and comes with ABSOLUTELY NO WARRANTY.
>  You are welcome to redistribute it under certain conditions.
>  Type 'license()' or 'licence()' for distribution details.
>
>   Natural language support but running in an English locale
>
>  R is a collaborative project with many contributors.
>  Type 'contributors()' for more information and
>  'citation()' on how to cite R or R packages in publications.
>
>  Type 'demo()' for some demos, 'help()' for on-line help, or
>  'help.start()' for an HTML browser interface to help.
>  Type 'q()' to quit R.
>   > plot(c(1,2,3),c(4,5,6))
>   > >>This plots a figure in X that can be resized,
>  minimized and closed without errors
>   >
>  Save workspace image? [y/n/c]:
>  Save workspace image? [y/n/c]: y
>  ~$ python
>  Python 2.5.1 (r251:54863, Mar  7 2008, 04:10:12)
>  [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on  
linux2
>  Type "help", "copyright", "credits" or "license" for more  
information.

>   >>> import rpy
>   >>> rpy.r.plot([1,2,3],[4,5,6])
>   >>>this plots a figure in X, when resizing,  
minimising, and
>  whenever the  X has to be redrawn, it kicks this error and  
terminates

>  the python session with error
>
>  >>> Error during wrapup: C stack usage is too close to the limit
>
> *** stack smashing detected ***: python terminated
>  Aborted (core dumped)
>  ~$
>   
-- 
--

>  sometimes this error is produced, and the X display stays open and
>  zombie, but control is returned to python
>
>   >>> rpy.r.plot([1,2,3],[4,5,6])
>
>  >>> Error during wrapup: C stack usage is too close to the limit
>
>   *** caught segfault ***
>
> address 0x18, cause 'memory not mapped'
>
>
>  Possible actions:
>  1: abort (with core dump, if enabled)
>  2: normal R exit
>  3: exit R without saving workspace
>  4: exit R saving workspace
>  Selection:
>   >>>
>
>  
-- 
---

>
>  Hope this can be solved. I'm willing to collaborate, but have no  
idea

>  where to start. Any clues?
>  Thanks
>
>  Andres
>
>
>
>
>  Lukasz Szybalski wrote:
>  > On Wed, Apr 9, 2008 at 3:26 AM, Laurent Gautier  
<[EMAIL PROTECTED]> wrote:

>  >
>  >> Issues with the C stack are encountered now and then, and  
this might

>  >>  be a problem
>  >>  with R:
>  >>  http://tolstoy.newcastle.edu.au/R/e4/help/08/01/2069.html
>  >>
>  >>  More generally, whenever the host application (here the Python
>  >>  process) is manipulating the stack (like when using threads  
I think)

>  >>  the problem might be more likely to appear.
>  >>
>  >>  What is probably needed is a 100% reproducible example (I  
have not
>  >>  looked at Lucas' yet) that would help locate precisely (and  
hopefully

>  >>  fix) the problem.
>  >>
>  >>
>  >
>  > So who ever experienced a similar error, could you try:
>  >
>  > I get an error here on each machine I have:
>  >
>  >
>   from rpy import *
>   x = range(1,11)
>   y = [i**2 for i in x]
>   z = [i**3 for i in x]
>   r.plot(x, y, main='My second plot', xlab='x', ylab='y',  
type='l',

>  
>  > col='blue')
>  >
>   r.lines(x, z, col='red')
>  
>  >
>  >
>  > Lucas
>  >
>  >  
-- 
---

>  > This SF.n

Re: [Rpy] Error during wrapup: C stack usage is too close tothelimit

2008-04-10 Thread Gregory Warnes


Ok, it looks like some code inserted to prevent issues on Win32,  
incorrectly disabled the changes everywhere.  I've just submitted a  
change to SVN that should resolve this issue.   I'll test it on OSX  
and Win32 and, if all goes well, release a new version with this  
correction.


-G

On Apr 10, 2008, at 9:17AM , Gregory Warnes wrote:



Hi All,

I'm sorry to hear that the C stack limit issue has arisen again.   
I'll check the source code to see if the fix that we put in for RC3  
has gotten removed or disabled somehow.


-Greg


On Apr 9, 2008, at 2:44PM , Laurent Gautier wrote:

I can reproduce it with python-2.5 / R-2.6.1 as well.

The error might well only have to do with X11 devices only, so
I wanted to try R-2.7.0 (since it will/should be using cairo devices
by default), but no luck: I already get error a RunTime error at load
time :-/ .

On the other end, I managed to try the code in the example with a
rewrite of rpy I am working on and R-2.7-alpha: no more crashing on
the C stack, but no refresh on resize (so blank window after
resizing).

Are Microsoft Windows users observing the C stack problem ?


L.

2008/4/9, A_Berger <[EMAIL PROTECTED]>:
>
>  I've been experiencing this error with several versions of rpy.  
The only
>  version that did work properly was Rpy1RC3, however newer  
versions of R
>  require newer versions of Rpy, and I had to update to a newer  
Rpy and
>  survive with the error. I've heard that this issue only arises  
on *nix

>  systems (i.e linux).
>  There are two errors that occur indistinctly when redrawing the X
>  display containing a plot.
>  Here is how it can be reproduced
>
>   
- 
---

>  ~$ R
>
>  R version 2.5.1 (2007-06-27)
>  Copyright (C) 2007 The R Foundation for Statistical Computing
>  ISBN 3-900051-07-0
>
>  R is free software and comes with ABSOLUTELY NO WARRANTY.
>  You are welcome to redistribute it under certain conditions.
>  Type 'license()' or 'licence()' for distribution details.
>
>   Natural language support but running in an English locale
>
>  R is a collaborative project with many contributors.
>  Type 'contributors()' for more information and
>  'citation()' on how to cite R or R packages in publications.
>
>  Type 'demo()' for some demos, 'help()' for on-line help, or
>  'help.start()' for an HTML browser interface to help.
>  Type 'q()' to quit R.
>   > plot(c(1,2,3),c(4,5,6))
>   > >>>>>>>>>>>>>>This plots a figure in X that can be resized,
>  minimized and closed without errors
>   >
>  Save workspace image? [y/n/c]:
>  Save workspace image? [y/n/c]: y
>  ~$ python
>  Python 2.5.1 (r251:54863, Mar  7 2008, 04:10:12)
>  [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on  
linux2
>  Type "help", "copyright", "credits" or "license" for more  
information.

>   >>> import rpy
>   >>> rpy.r.plot([1,2,3],[4,5,6])
>   >>>>>>>>>>>>>>>this plots a figure in X, when resizing,  
minimising, and
>  whenever the  X has to be redrawn, it kicks this error and  
terminates

>  the python session with error
>
>  >>> Error during wrapup: C stack usage is too close to the limit
>
> *** stack smashing detected ***: python terminated
>  Aborted (core dumped)
>  ~$
>   
- 
---

>  sometimes this error is produced, and the X display stays open and
>  zombie, but control is returned to python
>
>   >>> rpy.r.plot([1,2,3],[4,5,6])
>
>  >>> Error during wrapup: C stack usage is too close to the limit
>
>   *** caught segfault ***
>
> address 0x18, cause 'memory not mapped'
>
>
>  Possible actions:
>  1: abort (with core dump, if enabled)
>  2: normal R exit
>  3: exit R without saving workspace
>  4: exit R saving workspace
>  Selection:
>   >>>
>
>  
- 


>
>  Hope this can be solved. I'm willing to collaborate, but have  
no idea

>  where to start. Any clues?
>  Thanks
>
>  Andres
>
>
>
>
>  Lukasz Szybalski wrote:
>  > On Wed, Apr 9, 2008 at 3:26 AM, Laurent Gautier  
<[EMAIL PROTECTED]> wrote:

>  >
>  >> Issues with the C stack are encountered now and then, and  
this might

>  >>  be a problem
>  >>  with R:
>  >>  h

Re: [Rpy] installing rpy on a max running osx10.4

2008-04-16 Thread Gregory Warnes

Hi Mark

I do my rpy development on OSX 10.4, using python 2.4.2.

To install rpy, just download and unpack the source .tar.gz file,   
then run


python setup.py build
sudo python setup.py install

you'll probably want to ensure that Numpy is installed before you do  
this so you get better support for matrix objects on the python side.


-G




On Apr 16, 2008, at 5:35PM , Mark Thomas wrote:

Can anybody offer me any advice on installing rpy on a max running  
osx10.4.


I'm generally using python 2.5 but don't mind using 10.4 if necessary.

Thanks

Mark



-- 
---

This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save  
$100.

Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http:// 
java.sun.com/javaone

___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] making a data.frame with parameters in a fixed order

2008-04-29 Thread Gregory Warnes

Hello Andrew,

The basic problem you are encountering is that  python uses a  
dictionary to store named parameters to function calls.  Python's  
dictionaries don't preserve order, just name-value correspondence.   
As a consequence calling an R function with named arguments loses the  
ordering.  AFAIK, nothing can be done about that.


There are a couple of solutions.  One, as you describe, is to  
construct an R expression in a string and have R evaluate the  
string.   Another solution is to create the data frame object without  
names, then add the names in a separate step.  You can also construct  
an empty data frame and add one column at a time to it.  Finally, you  
can create an R utility function do to the work you need.


As an example of the last approach consider:


f>>> from rpy import *
set_default_mode(NO_CONVERSION)
>>> set_default_mode(NO_CONVERSION)
>>>
>>>
>>>
>>> makeDF = r("""
...function( ..., names)
...   {
... df <- data.frame(...)
... names(df) <- names
... df
...  }
... """)
>>>
>>>
>>> makeDF( 1, 2, 3, names=["A","B","C"] )

>>> df = makeDF( 1, 2, 3, names=["A","B","C"] )
>>> r.print_(df)
  A B C
1 1 2 3



-Greg

On Apr 28, 2008, at 5:29PM , Andrew Dalke wrote:


I'm having problems using RPy to create a data.frame which is passed
to an R function.

The problem is that I need to initialize the data.frame with the
parameters in a specified order. The normal way, of doing

r.data_frame(MW=120.3, NUM_C=5, SMILES="c1n1")

does not work because the parameter order is not a well defined
property, while in R is seems to be fixed.  That is, "MW" in this
case is the first parameter, "NUM_C" is the second, and "SMILES" is
the third.

   This is important because some of the code I have to deal with
turns the data.frame input into a matrix.

   I got things working the hard and wrong way.  I did

r("data.frame(MW=120.3, NUM_C=5, SMILES='c1n1')")

along with asking RPy to not convert the returned data.frame into a
dictionary.

   That works, but I'm worried about proper escape rules.  Eg, what
happens if the string contains a "'" character?

   The only other trick I could think of would be to assign the
inputs to a temporary variable, at the Python side of thing (letting
RPy handle the escapes) then refer to the R variables inside of the
data.frame() function call.

   I looked in the archive and online but I couldn't find a better
way to do this.

   Do any of you all have any ideas?

Andrew
[EMAIL PROTECTED]



-- 
---

This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save  
$100.

Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http:// 
java.sun.com/javaone

___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list



-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] undefined symbol: KillAllDevices

2008-05-12 Thread Gregory Warnes

The fix for this bug has been submitted to SVN.

-G


On May 12, 2008, at 2:26PM , John Reid wrote:

Well I seemed to have fixed it by changing the call to  
KillAllDevices()

in rpymodule.c to Rf_KillAllDevices() as is defined in libR.so.

Perhaps there's a better way?

Thanks for a great rpy package BTW,
John.



John Reid wrote:
> I get this error when I import rpy:
> /usr/local/lib/python2.5/site-packages/_rpy2070.so: undefined  
symbol:

> KillAllDevices
>
>RPy module can not be imported. Please check if your rpy
>installation supports R 2.7.0. If you have multiple R  
versions
>installed, you may need to set RHOME before importing rpy.  
For

>example:
>
>>>> from rpy_options import set_options
>>>> set_options(RHOME='c:/progra~1/r/rw2011/')
>>>> from rpy import *
>
>
>
>
> Compilation of rpy 1.0.2 and R 2.7.0 seems fine. I am on Suse  
Linux 10.3

> with gcc 4.1.2
>
> Any ideas what I might be doing wrong?
>
> Thanks,
> John.
>
>
>  
-- 
---

> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/


-- 
---

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list



-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] Another Mac install question

2008-05-12 Thread Gregory Warnes


The standard Mac version of R includes the necessary shared library,  
hence it is not necesary to do this.  You should be able to simply run


cd /path/to/rpy/source/code/

python setup.py build

sudo python setup.py install

and everything should install properly, at least it does on my Mac  
OSX 10.4.11 box...


-G


On May 12, 2008, at 9:51PM , David Garfield wrote:


Hey all,

  I'm trying to install RPy on my Mac (OS 4.11).  My version of R  
was installed from the pre-compiled binaries from CRAN (the one  
with the nice GUI attached), and hence I don't have access (or  
don't know how to access) R's source directory to carry out the  
(apparently) crucial:


(go to the R source directory)
make distclean
./configure --enable-R-shlib
make
make install


I found a previous thread on the mailing list (included below from  
July 31st of 2007), but I couldn't find an answer to the question.   
Is there anything I need to do to make sure that I have the shared  
libraries correct before installing RPy?


Cheers,

David


PREVIOUS MESSAGE
Hi

I have spent most of today trying to install rpy on my Mac  
(osx10.4.10). I
have python 2.5.1 and R version 2.5.0 (2007-04-23). Both work fine;  
R was
installed using the Precompiled binary distribution, python was  
installed

using the Pre-built packages installer from http://www.pythonmac.org/.

Has anybody ever managed to install rpy under these circumstances?

Any help gratefully received.

Many thanks

Mark
-- 
---

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ 



-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] again installation on Mac OS X

2008-05-14 Thread Gregory Warnes


Hi Ernesto,

These warning messages are normal, albeit annoying.I've just made  
commited changes to the the SVN repository to avoid the ones from  
rpymodule.c and io.c, so this should be less of a problem in the future.


-Greg


On May 14, 2008, at 3:34AM , Ernesto wrote:


Dear all,

I'm trying to install rpy on my Mac OS X 10.4. I currently use python
2.4 and R 2.5.1. I followed instructions found in the README file and
other past messagges. I went into the main rpy folder running the
following command:

python setup.py build

and I had the message:

RHOMES= []
DEBUG= True
Setting RHOMES to  ['/Library/Frameworks/R.framework/Resources']
### Using R verion 2.5.1 installed at /Library/Frameworks/R.framework/
Resources ###
RHOME= /Library/Frameworks/R.framework/Resources
copying src/rpymodule.c -> src/rpymodule2051.c
copying src/R_eval.c -> src/R_eval2051.c
copying src/io.c -> src/io2051.c
running build
running build_py
creating build
creating build/lib.macosx-10.3-fat-2.4
copying rpy.py -> build/lib.macosx-10.3-fat-2.4
copying rpy_io.py -> build/lib.macosx-10.3-fat-2.4
copying rpy_version.py -> build/lib.macosx-10.3-fat-2.4
copying rpy_tools.py -> build/lib.macosx-10.3-fat-2.4
copying rpy_options.py -> build/lib.macosx-10.3-fat-2.4
copying rpy_wintools.py -> build/lib.macosx-10.3-fat-2.4
running build_ext
building '_rpy2051' extension
C compiler: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/
MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp
-mno-fused-madd -fno-common -dynamic -g -Wall

creating build/temp.macosx-10.3-fat-2.4
creating build/temp.macosx-10.3-fat-2.4/src
compile options: '-DWITH_NUMERIC=3 -DPY_ARRAY_TYPES_PREFIX=PyArray_ -
DRPY_SHNAME=_rpy2051 -DINIT_RPY=init_rpy2051 -UPRE_2_2 -I/Library/
Frameworks/R.framework/Resources/include -Isrc -I/Library/Frameworks/
Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/core/
include -I/Library/Frameworks/Python.framework/Versions/2.4/include/
python2.4 -c'
gcc: src/R_eval2051.c
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-
packages/numpy/core/include/numpy/__multiarray_api.h:944: warning:
'_import_array' defined but not used
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-
packages/numpy/core/include/numpy/__multiarray_api.h:944: warning:
'_import_array' defined but not used
gcc: src/io2051.c
src/io2051.c: In function 'RPy_ReadConsole':
src/io2051.c:133: warning: pointer targets in passing argument 1 of
'snprintf' differ in signedness
src/io2051.c: In function 'RPy_ReadConsole':
src/io2051.c:133: warning: pointer targets in passing argument 1 of
'snprintf' differ in signedness
src/io2051.c: At top level:
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-
packages/numpy/core/include/numpy/__multiarray_api.h:944: warning:
'_import_array' defined but not used
src/io2051.c: At top level:
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-
packages/numpy/core/include/numpy/__multiarray_api.h:944: warning:
'_import_array' defined but not used
gcc: src/rpymodule2051.c
src/rpymodule2051.c: In function 'r_finalize':
src/rpymodule2051.c:1788: warning: implicit declaration of function
'R_CleanTempDir'
src/rpymodule2051.c:1776: warning: unused variable 'tmpdir'
src/rpymodule2051.c:1775: warning: unused variable 'buf'
src/rpymodule2051.c: In function 'r_finalize':
src/rpymodule2051.c:1788: warning: implicit declaration of function
'R_CleanTempDir'
src/rpymodule2051.c:1776: warning: unused variable 'tmpdir'
src/rpymodule2051.c:1775: warning: unused variable 'buf'
gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
-bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.4/src/
rpymodule2051.o build/temp.macosx-10.3-fat-2.4/src/R_eval2051.o build/
temp.macosx-10.3-fat-2.4/src/io2051.o -L/Library/Frameworks/
R.framework/Resources/bin -L/Library/Frameworks/R.framework/Resources/
lib -L/Library/Frameworks/R.framework/Resources/bin -L/Library/
Frameworks/R.framework/Resources/lib -lR -o build/lib.macosx-10.3-
fat-2.4/_rpy2051.so


If you can see there are a lot of warnings. Is there any error?

Thank you in advance,

Ernesto

-- 
---

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list



-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] Version 1.0.3 now available

2008-05-14 Thread Gregory Warnes

Too bad.

I guess I'll have to either add code to look for

libRlapack.so

in the appropriate directory.  Know of any simple way to do this?

-G


On May 14, 2008, at 10:16AM , Dirk Eddelbuettel wrote:



Hi Greg,

On Wed, May 14, 2008 at 10:08:29AM -0400, Gregory. R. Warnes wrote:
>
> Hi Dirk,
>
> Is it sufficient to simply add lapack to the list of libraries?
>
> libraries=['R','Rlapack','lapack']

Nice idea, but I'm afraid no cigar yet. From a test build I just  
launched:


[...]
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -O2 -Wall  
build/temp.linux-i686-2.5/src/rpymodule2070.o build/temp.linux- 
i686-2.5/src/R_eval2070.o build/temp.linux-i686-2.5/src/io2070.o  
build/temp.linux-i686-2.5/src/setenv.o -L/usr/lib/R/bin -L/usr/lib/ 
R/lib -Wl,-R/usr/lib/R/bin -Wl,-R/usr/lib/R/lib -lR -lRlapack - 
llapack -o build/lib.linux-i686-2.5/_rpy2070.so

/usr/bin/ld: cannot find -lRlapack
collect2: ld returned 1 exit status
/usr/bin/ld: cannot find -lRlapack
collect2: ld returned 1 exit status
error: Command "gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic- 
functions -O2 -Wall build/temp.linux-i686-2.5/src/rpymodule2070.o  
build/temp.linux-i686-2.5/src/R_eval2070.o build/temp.linux- 
i686-2.5/src/io2070.o build/temp.linux-i686-2.5/src/setenv.o -L/usr/ 
lib/R/bin -L/usr/lib/R/lib -Wl,-R/usr/lib/R/bin -Wl,-R/usr/lib/R/ 
lib -lR -lRlapack -llapack -o build/lib.linux-i686-2.5/_rpy2070.so"  
failed with exit status 1

make: *** [build-stamp] Error 1
dpkg-buildpackage: failure: debian/rules build gave error exit  
status 2

pbuilder: Failed autobuilding of package

Dirk


--
Three out of two people have difficulties with fractions.

-- 
---

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list



-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] Version 1.0.3 now available

2008-05-14 Thread Gregory Warnes
I just committed a change to use R CMD config LAPACK_LIBS.  Can you  
check if it behaves properly?


-G

On May 14, 2008, at 1:14PM , Dirk Eddelbuettel wrote:


On Wed, May 14, 2008 at 01:06:38PM -0400, Gregory Warnes wrote:
> Too bad.
>
> I guess I'll have to either add code to look for
>
>   libRlapack.so
>
> in the appropriate directory.  Know of any simple way to do this?

Glad you asked :) I remembered that 'R CMD ...' added the new command
'config' not too long ago. Asking for the linker options didn't do it,
but you can query individual variables -- such as LAPACK_LIBS.

So on my Ubuntu 7.10 system with the older Rlapack:

$ R CMD config LAPACK_LIBS
-L/usr/lib/R/lib -lRlapack

whereas my Debian system with newer Atlas etc pp has

$ R CMD config LAPACK_LIBS
-llapack

So maybe you'll have setup.py talk to 'R CMD config LAPACK_LIBS' ?

Dirk

--
Three out of two people have difficulties with fractions.

-- 
---

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list



-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] Version 1.0.3 now available

2008-05-14 Thread Gregory Warnes

Yea!


On May 14, 2008, at 3:08PM , Dirk Eddelbuettel wrote:


On Wed, May 14, 2008 at 02:36:27PM -0400, Gregory Warnes wrote:
> I just committed a change to use R CMD config LAPACK_LIBS.  Can you
> check if it behaves properly?

I get the commit emails, so I just hand-applied the changes to the  
two files.

Seems to work fine -- i.e. it built.  So thumbs up!

Dirk

--
Three out of two people have difficulties with fractions.

-- 
---

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list



-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] Install successfully once, but fail afterward

2008-05-14 Thread Gregory Warnes

Hmm.

Does rerunning the install make a difference?

-G


On May 14, 2008, at 4:44PM , Manu Hack wrote:


Hi,

I just installed R and rpy on Opensuse 10.3.  I managed to get it  
work once.  But then all of a sudden it won't work again.  Here is  
the info.


I compiled R-2.7.0 with configure --enable-R-shlib.  And it's  
installed in the standard location, /usr/local/lib64/R


$ls /usr/local/lib64/R/lib
libRblas.so  libRlapack.so  libR.so


So I can run R.

$ R
> version
   _
platform   x86_64-unknown-linux-gnu
arch   x86_64
os linux-gnu
system x86_64, linux-gnu
status
major  2
minor  7.0
year   2008
month  04
day22
svn rev45424
language   R
version.string R version 2.7.0 (2008-04-22)

Now, on python, I try to import rpy and get

> python
Python 2.5.1 (r251:54863, Jan 10 2008, 18:00:49)
[GCC 4.2.1 (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.append('/home/kcma/local/lib64/python2.5/site-packages')
>>> from rpy_options import set_options
>>> set_options(VERBOSE=True)
>>> import rpy
RHOME= /usr/local/lib64/R
RVERSION= 2.7.0
RVER= 2070
RUSER= /home/manu
Loading Rpy version 2070 ..
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/manu/local/lib64/python2.5/site-packages/rpy.py",  
line 134, in 

""" % RVERSION)
RuntimeError: libR.so: cannot open shared object file: No such file  
or directory


  RPy module can not be imported. Please check if your rpy
  installation supports R 2.7.0. If you have multiple R versions
  installed, you may need to set RHOME before importing rpy. For
  example:

  >>> from rpy_options import set_options
  >>> set_options(RHOME='c:/progra~1/r/rw2011/')
  >>> from rpy import *


Weird enough, I managed to sucessfully run rpy once but later on  
this error persists.  Let me know if you want more info.


Manu
-- 
---

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ 



-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] Install successfully once, but fail afterward

2008-05-14 Thread Gregory Warnes


Is there a difference in the environment variables, particularly the  
value of RHOME?


-G

On May 14, 2008, at 5:39PM , Manu Hack wrote:

On Wed, May 14, 2008 at 4:49 PM, Gregory Warnes  
<[EMAIL PROTECTED]> wrote:

Hmm.

Does rerunning the install make a difference?

-G

No, one more information is that when I was able to run it, on that  
terminal, I can run it without problem.  But in the other terminal,  
I can't run it (getting the error in the previous post).  And today  
I have been recompiling and reinstalling still didn't get it work  
nor understand what's going on.


Manu
-- 
---

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ 



-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] filled.contour

2008-05-15 Thread Gregory Warnes


Hello Lars,

You will need to create an R function to accomplish the needed task.   
One way is to put everything into one bug R function:



from rpy import r

r.pdf(filename,onefile=r.TRUE, width = 7.8, height = 7,)

my_contour = r("""
  function(x, y, z, n=20)
{
  Lab.palette <- colorRampPalette(c("blue", "white", "red"),
  space = "Lab")

  filled.contour(x=x,
 y=y,
 z=z,
 xlab='xlab',
 ylab='ylab',
 #xlim=c(1,n), ylim=c(1,n),
 col = Lab.palette(20),
 levels = pretty(c(-1,1), n),
 nlevels = n,
 asp = 1,
 main="Contour map",
 plot.axes= {
  axis(1);
  axis(2);
  points(10,10)
}
 )

  }
""")

my_contour(x, y, z)



Another option is to put just the argument to plot.axes in a function,

r.filled_contour(...
plot_axes = r("function() {axes 
(1); axes(2); points(10,10)}")

   )

-Greg



On May 15, 2008, at 10:55AM , Lars Skjærven wrote:


Dear Rpy'ers,
I am using the "filled.contour"-function to produce a contour map. I
need to draw vertical and horisontal lines within this map related to
its coordinate system. The problem is when the legend is drawn, it
destroys the original coorinatesystem as described in the R-manual.
The manual suggest a workaround:
filled.contour(x = 1:20, y = 1:20, z = b, plot.axes={ axis(1);
axis(2); points(10,10) })

Using this in rpy results in the following error:
plot.new has not been called yet

Any suggestions are highly appreciated.

Attached is a copy of my Rpy code.

Best regards,
LarsS
-
r.pdf(filename,onefile=r.TRUE, width = 7.8, height = 7,)
r.Lab_palette = r.colorRampPalette(r.c("blue", "white", "red"),  
space = "Lab");


r.filled_contour(x=x,
 y=y,
 z=matrix,
 xlab='xlab',
 ylab='ylab',
 xlim=r.c(1,n), ylim=r.c(1,n),
 col = r.Lab_palette(20),
 levels = r.pretty( r.c(-1,1), 20),
 nlevels = 20,
 asp = 1,
 main="Contour map",
 plot_axes= [r.axis(1),r.axis(2), r.points 
(10,10)] )


-- 
---

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list



-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] Install successfully once, but fail afterward

2008-05-19 Thread Gregory Warnes

Any luck?

To see what is different between the environments in the two windows,  
you can do:


In window 1:

env > /tmp/env.1.txt

In window 2:

env > /tmp/env2.txt

and then use 'diff' or 'sdiff' to check for differences.

-G

On May 14, 2008, at 6:08PM , Manu Hack wrote:




On Wed, May 14, 2008 at 5:50 PM, Gregory Warnes  
<[EMAIL PROTECTED]> wrote:


Is there a difference in the environment variables, particularly  
the value of RHOME?


-G

No, RHOME are the same.




On May 14, 2008, at 5:39PM , Manu Hack wrote:

On Wed, May 14, 2008 at 4:49 PM, Gregory Warnes  
<[EMAIL PROTECTED]> wrote:

Hmm.

Does rerunning the install make a difference?

-G

No, one more information is that when I was able to run it, on  
that terminal, I can run it without problem.  But in the other  
terminal, I can't run it (getting the error in the previous  
post).  And today I have been recompiling and reinstalling still  
didn't get it work nor understand what's going on.


Manu
- 


This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ 




-- 
---

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


-- 
---

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ 



-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


  1   2   3   >