On Fri, Feb 5, 2010 at 7:50 PM, John A Schroeder <john.schroe...@inl.gov> wrote: > > I am trying to get the two most basic RPy examples to work. I am on a > Windows XP platform (also trying Window 7, and OpenSUSE 11.2, none work, all > seem to have different problems!) I have both rpy and rpy2 installed. I > have R version 2.10.1, and Python 2.6. Also the most recent versions of > NumPy and SciPy. Consider EXAMPLE 1 below. This example works, however, > EXAMPLE 2 below does not. EXAMPLE 3 shows what happens when I try the > "faithful" example. > > I am hoping to use RPy to process simulation output from SimPy. Getting > the "faithful" example to work would be a very good start! Can anyone point > me in the right direction? > > ... > > EXAMPLE 2. -- This does not work! > > from rpy import * > > def main(): > degrees = 4 > grid = r.seq(0, 10, length=100) > values = [r.dchisq(x, degrees) for x in grid] > r.par(ann=0) > r.plot(grid, values, type='l') > > if __name__ == '__main__': main() > > > This example produces the following result: > > Traceback (most recent call last): > File "D:\Users\roe\Eclipse\workspace\SimPyProjects\src\RPy01.py", line 7, > in <module> > from rpy import * > File "C:\Python26\lib\site-packages\rpy.py", line 58, in <module> > RVERSION = rpy_tools.get_R_VERSION(RHOME) > File "C:\Python26\lib\site-packages\rpy_tools.py", line 103, in > get_R_VERSION > raise RuntimeError("Couldn't obtain version number from output\n" > RuntimeError: Couldn't obtain version number from output > of `R --version'. > > > When I check the R version manually at the command prompt I get: > > D:\Users\roe>R --version > R version 2.10.1 (2009-12-14) > Copyright (C) 2009 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 the terms of the > GNU General Public License version 2. > For more information about these matters see > http://www.gnu.org/licenses/.
I recall seeing a bug report and fix to cope with the two digit minor release number (the 10 in 2.10.1), try this: https://sourceforge.net/tracker/?func=detail&atid=453021&aid=2940558&group_id=48422 These days rpy1 doesn't get so much attention (almost all work is on rpy2 now), but I think it would be nice to have another point release to include this fix for supporting recent versions of R. There are still plenty of people like me with old rpy1 scripts ;) Peter ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list