Ok, thank you! I had no idea about that. I tried
>>> from rpy2 import *

and python accepted it without any complaints.

But now my problem is how to call r functions. I tried the example in the 
README file
>>> values = [r.dchisq(x, 4) for x in r.seq(0, 10, by=0.1)]

and got an error message:
        Traceback (most recent call last):
          File "<pyshell#1>", line 1, in <module>
            values = [r.dchisq(x, 4) for x in r.seq(0, 10, by=0.1)]
        NameError: name 'r' is not defined

If I remove the r. and type
>>> values = [dchisq(x, 4) for x in seq(0, 10, by=0.1)]

I get another error message:
        Traceback (most recent call last):
          File "<pyshell#3>", line 1, in <module>
            values = [dchisq(x, 4) for x in seq(0, 10, by=0.1)]
        NameError: name 'seq' is not defined

What is wrong?

Thankful for your help,
Eva

-----Original Message-----
From: Peter [mailto:rpy-l...@maubp.freeserve.co.uk] 
Sent: den 4 januari 2010 18:46
To: RPy help, support and design discussion list
Subject: Re: [Rpy] rpy in Windows, how to get started?

On Mon, Jan 4, 2010 at 2:39 PM, Eva Lindberg <eva.lindb...@srh.slu.se> wrote:
> Hi,
>
> I have used R before and I am now learning python so of course I want to
> connect them using rpy.
>
> I am working in Windows and I have followed the steps in
> http://rpy.sourceforge.net/rpy/README. I'm using R-2.10.1 so I have added
> C:\Program Files\R\R-2.10.1\bin to my path variable.
>
> When I try
>
>>>> from rpy import *
>
> I get an error message:
>

You installed rpy 2.10.1, so you should import rpy2 not rpy.
This is because rpy 2 isn't API compatible with rpy 1, and
means you can have both installed at the same time.

Peter

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
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 Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to