[Rpy] SF.net SVN: rpy: [489] trunk/rpy/rpy.py
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] [ rpy-Bugs-1931617 ] module _rpy2062 not included
Bugs item #1931617, was opened at 2008-04-01 16:23 Message generated for change (Comment added) made by warnes You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=453021&aid=1931617&group_id=48422 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: Build Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: module _rpy2062 not included Initial Comment: Module _rpy2062 did not seem to be included in the download package rpy-1.0.1-R-1.3.0-to-2.6.1-Numpy-win32-py2.5.exe -- >Comment By: Gregory Warnes (warnes) Date: 2008-04-16 10:16 Message: Logged In: YES user_id=9316 Originator: NO Fixed in 1.0.2 -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=453021&aid=1931617&group_id=48422 - 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] [ rpy-Bugs-1908350 ] the R.__repr__ method is broken
Bugs item #1908350, was opened at 2008-03-05 17:07 Message generated for change (Comment added) made by warnes You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=453021&aid=1908350&group_id=48422 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: rpy Status: Open >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) >Assigned to: Gregory Warnes (warnes) Summary: the R.__repr__ method is broken Initial Comment: $ python Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32) [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 Traceback (most recent call last): File "", line 1, in File "rpy.py", line 323, in __repr__ Rver = self.__getitem__('R_version_string') File "rpy.py", line 306, in __getitem__ obj = self.__dict__[name] = self.__dict__.get(name, self.get(name)) rpy.RPy_RException: Error in get(x, envir, mode, inherits) : variable "R_version_string" was not found Note: I used the 1.0.1 release of rpy. -- >Comment By: Gregory Warnes (warnes) Date: 2008-04-16 10:57 Message: Logged In: YES user_id=9316 Originator: NO Fixed in svn, will be part of next release. -- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=453021&aid=1908350&group_id=48422 - 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: [490] branches/rpy_nextgen/rpy/rinterface/tests/ test_SexpVector.py
Revision: 490 http://rpy.svn.sourceforge.net/rpy/?rev=490&view=rev Author: lgautier Date: 2008-04-16 12:14:12 -0700 (Wed, 16 Apr 2008) Log Message: --- code layout Modified Paths: -- branches/rpy_nextgen/rpy/rinterface/tests/test_SexpVector.py Modified: branches/rpy_nextgen/rpy/rinterface/tests/test_SexpVector.py === --- branches/rpy_nextgen/rpy/rinterface/tests/test_SexpVector.py 2008-04-16 14:19:47 UTC (rev 489) +++ branches/rpy_nextgen/rpy/rinterface/tests/test_SexpVector.py 2008-04-16 19:14:12 UTC (rev 490) @@ -70,9 +70,12 @@ self.assertTrue(ok) def testNewVector(self): -sexp_char = rinterface.SexpVector(["abc", ], rinterface.STRSXP) -sexp_int = rinterface.SexpVector([1, ], rinterface.INTSXP) -sexp = rinterface.SexpVector([sexp_char, sexp_int], rinterface.VECSXP) +sexp_char = rinterface.SexpVector(["abc", ], + rinterface.STRSXP) +sexp_int = rinterface.SexpVector([1, ], + rinterface.INTSXP) +sexp = rinterface.SexpVector([sexp_char, sexp_int], + rinterface.VECSXP) isList = rinterface.globalEnv.get("is.list") ok = isList(sexp)[0] self.assertTrue(ok) @@ -111,12 +114,14 @@ c_R = rinterface.globalEnv.get("c") myVec = c_R(rinterface.SexpVector([0, 1, 2, 3, 4, 5], rinterface.INTSXP)) #import pdb; pdb.set_trace() -self.assertRaises(ValueError, myVec.__setitem__, 0, rinterface.SexpVector(["a", ], rinterface.STRSXP)) +self.assertRaises(ValueError, myVec.__setitem__, 0, + rinterface.SexpVector(["a", ], rinterface.STRSXP)) def testAssignItemOutOfBound(self): c_R = rinterface.globalEnv.get("c") myVec = c_R(rinterface.SexpVector([0, 1, 2, 3, 4, 5], rinterface.INTSXP)) -self.assertRaises(IndexError, myVec.__setitem__, 10, rinterface.SexpVector([1, ], rinterface.INTSXP)) +self.assertRaises(IndexError, myVec.__setitem__, 10, + rinterface.SexpVector([1, ], rinterface.INTSXP)) def testAssignItemInt(self): c_R = rinterface.globalEnv.get("c") @@ -129,7 +134,8 @@ def testAssignItemReal(self): c_R = rinterface.globalEnv.get("c") -myVec = c_R(rinterface.SexpVector([0.0, 1.0, 2.0, 3.0, 4.0, 5.0], rinterface.REALSXP)) +myVec = c_R(rinterface.SexpVector([0.0, 1.0, 2.0, 3.0, 4.0, 5.0], + rinterface.REALSXP)) myVec[0] = rinterface.SexpVector([100.0, ], rinterface.REALSXP) self.assertTrue(floatEqual(myVec[0], 100.0)) @@ -138,7 +144,8 @@ def testAssignItemLogical(self): c_R = rinterface.globalEnv.get("c") -myVec = c_R(rinterface.SexpVector([True, False, True, True, False], rinterface.LGLSXP)) +myVec = c_R(rinterface.SexpVector([True, False, True, True, False], + rinterface.LGLSXP)) myVec[0] = rinterface.SexpVector([False, ], rinterface.LGLSXP) self.assertFalse(myVec[0]) @@ -147,7 +154,8 @@ def testAssignItemComplex(self): c_R = rinterface.globalEnv.get("c") -myVec = c_R(rinterface.SexpVector([1.0+2.0j, 2.0+2.0j, 3.0+2.0j, 4.0+2.0j, 5.0+2.0j], rinterface.CPLXSXP)) +myVec = c_R(rinterface.SexpVector([1.0+2.0j, 2.0+2.0j, 3.0+2.0j, 4.0+2.0j, 5.0+2.0j], + rinterface.CPLXSXP)) myVec[0] = rinterface.SexpVector([100.0+200.0j, ], rinterface.CPLXSXP) self.assertTrue(floatEqual(myVec[0].real, 100.0)) self.assertTrue(floatEqual(myVec[0].imag, 200.0)) @@ -159,21 +167,24 @@ def testAssignItemList(self): myVec = rinterface.SexpVector([rinterface.SexpVector(["a", ], rinterface.STRSXP), rinterface.SexpVector([1, ], rinterface.INTSXP), - rinterface.SexpVector([3, ], rinterface.INTSXP)], rinterface.VECSXP) + rinterface.SexpVector([3, ], rinterface.INTSXP)], + rinterface.VECSXP) -myVec[0] = rinterface.SexpVector([rinterface.SexpVector([100.0, ], rinterface.REALSXP), ], rinterface.VECSXP) +myVec[0] = rinterface.SexpVector([rinterface.SexpVector([100.0, ], rinterface.REALSXP), ], + rinterface.VECSXP) self.assertTrue(floatEqual(myVec[0][0][0], 100.0)) -myVec[2] = rinterface.SexpVector([rinterface.SexpVector(["a", ], rinterface.STRSXP), ], rinterface.VECSXP) +myVec[2] = rinterface.SexpVector([rinterface.SexpVector(["a", ], rinterface.STRSXP), ], + rinterface.VECSXP)
[Rpy] SF.net SVN: rpy: [491] branches/rpy_nextgen/demos
Revision: 491 http://rpy.svn.sourceforge.net/rpy/?rev=491&view=rev Author: lgautier Date: 2008-04-16 12:16:28 -0700 (Wed, 16 Apr 2008) Log Message: --- Toy R GUI as an example (might be worth it making a real GUI). Modified Paths: -- branches/rpy_nextgen/demos/radmin.py Added Paths: --- branches/rpy_nextgen/demos/rpy2_logo.png Modified: branches/rpy_nextgen/demos/radmin.py === --- branches/rpy_nextgen/demos/radmin.py2008-04-16 19:14:12 UTC (rev 490) +++ branches/rpy_nextgen/demos/radmin.py2008-04-16 19:16:28 UTC (rev 491) @@ -2,17 +2,19 @@ pygtk.require('2.0') import gtk import rpy2.robjects as robjects +import itertools +import gobject - - class LibraryPanel(gtk.VBox): cell = gtk.CellRendererText() cell.set_property('cell-background', 'black') cell.set_property('foreground', 'white') - -def __init__(self): +PACKAGE_I = 0 + +def __init__(self, console=None): super(LibraryPanel, self).__init__() +self._console = console self._table = gtk.ListStore(str, str, str) self.updateInstalledLibraries() self._treeView = gtk.TreeView(model = self._table) @@ -30,10 +32,13 @@ sbox = gtk.HBox(homogeneous=False, spacing=0) sbox.show() +slabel = gtk.Label("Search:") +slabel.show() +sbox.pack_start(slabel, True, True, 0) self.sentry = gtk.Entry() self.sentry.show() sbox.add(self.sentry) -sbutton = gtk.Button("Search") +sbutton = gtk.Button("Refresh") sbutton.connect("clicked", self.searchAction, "search") sbutton.show() sbox.add(sbutton) @@ -44,6 +49,14 @@ s_window.show() s_window.add(self._treeView) self.add(s_window) + +lbox = gtk.HBox(homogeneous=False, spacing=0) +lbox.show() +lbutton = gtk.Button("Load") +lbutton.connect("clicked", self.loadAction, "load") +lbutton.show() +lbox.add(lbutton) +self.pack_start(lbox, expand=False, fill=False, padding=0) def updateInstalledLibraries(self): self._table.clear() @@ -76,9 +89,31 @@ for r in toremove: self._table.remove(self._table.get_iter(r)) +def loadAction(self, widget, data=None): +# Get the selection in the gtk.TreeView + selection = self._treeView.get_selection() + # Get the selection iter + model, selection_iter = selection.get_selected() +if selection_iter: +packName = self._table.get_value(selection_iter, +self.PACKAGE_I) +self._console.append('library("%s")\n' %packName) + +tmp = robjects.baseNameSpaceEnv["fifo"]("") +robjects.baseNameSpaceEnv["sink"](tmp) + +robjects.baseNameSpaceEnv["library"](packName) +out = robjects.baseNameSpaceEnv["readLines"](tmp) +for line in out: +self._console.append(str(line)+"\n") +robjects.r.close(tmp) +self._console.append("> ") + class VignetteExplorer(gtk.VBox): +PACKAGE_I = 0 +ITEM_I = 1 def __init__(self): super(VignetteExplorer, self).__init__() self._table = gtk.ListStore(str, str, str) @@ -95,6 +130,7 @@ col.pack_start(cr, True) self._valueCells.append(cr) col.set_attributes(cr, text=col_i) + sbox = gtk.HBox(homogeneous=False, spacing=0) #sbox.show() sentry = gtk.Entry() @@ -110,6 +146,13 @@ s_window.show() s_window.add(self._treeView) self.add(s_window) +vbox = gtk.HBox(homogeneous=False, spacing=0) +vbox.show() +vbutton = gtk.Button("View") +vbutton.connect("clicked", self.viewAction, "view") +vbutton.show() +vbox.add(vbutton) +self.pack_start(vbox, expand=False, fill=False, padding=0) def updateKnownVignettes(self): self._table.clear() @@ -126,6 +169,76 @@ row.append(pack) self._table.append(row) +def viewAction(self, widget, data=None): +# Get the selection in the gtk.TreeView + selection = self._treeView.get_selection() + # Get the selection iter + model, selection_iter = selection.get_selected() +if selection_iter: +packName = self._table.get_value(selection_iter, + self.PACKAGE_I) +vigName = self._table.get_value(selection_iter, +self.ITEM_I) +robjects.r.vignette(vigName, package = packName) + + +class GraphicalDeviceExplorer(gtk.VBox): + +def __init__(self): +super(GraphicalDeviceExplorer, self).__init__() +self._table = gtk.Lis
[Rpy] installing rpy on a max running osx10.4
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
Re: [Rpy] installing rpy on a max running osx10.4
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