[Rpy] load R-library via rpy2

2009-01-07 Thread Oliver Tomic

Hi,

I am sorry about this trivial question, but what is the obvious way to
import a library in R in via rpy2?

If I do the following in R:

> library(epiR)
Package epiR 0.9-14 is loaded
Type help(epi.about) for summary information
>


What is the equivalent in rpy2?


Windows XP
Python 2.5
rpy2 2.0.0
R 2.8.0

Thanks for you help!

Cheers
Oliver--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] load R-library via rpy2

2009-01-07 Thread Oliver Tomic
I forgot to mention that I tried the following with rpy2, but without
success:

>>> import rpy2.robjects as robjects
>>> robjects.r['library(epiR)']

Traceback (most recent call last):
  File "", line 1, in 
robjects.r['library(epiR)']
  File "C:\Python25\Lib\site-packages\rpy2\robjects\__init__.py", line 503,
in __getitem__
res = rinterface.globalEnv.get(item)
LookupError: 'library(epiR)' not found

Cheers
Oliver


Oliver Tomic  wrote on 07.01.2009 10:18:28:

> Hi,
>
> I am sorry about this trivial question, but what is the obvious way
> to import a library in R in via rpy2?
>
> If I do the following in R:
>
> > library(epiR)
> Package epiR 0.9-14 is loaded
> Type help(epi.about) for summary information
> >
>
>
> What is the equivalent in rpy2?
>
>
> Windows XP
> Python 2.5
> rpy2 2.0.0
> R 2.8.0
>
> Thanks for you help!
>
> Cheers
> Oliver
>
--

> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB___
> 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 is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] load R-library via rpy2

2009-01-07 Thread Laurent Gautier
Hi Oliver,

'(' is not '['.

Check
http://rpy.sourceforge.net/rpy2/doc/html/introduction.html#calling-r-functions
then
http://rpy.sourceforge.net/rpy2/doc/html/robjects.html?highlight=evaluate#strings-as-r-code
and eventually
http://rpy.sourceforge.net/rpy2/doc/html/robjects.html?highlight=evaluate#r-the-instance-of-r


L.



Oliver Tomic wrote:
> I forgot to mention that I tried the following with rpy2, but without 
> success:
> 
>  >>> import rpy2.robjects as robjects
>  >>> robjects.r['library(epiR)']
> 
> Traceback (most recent call last):
> File "", line 1, in 
> robjects.r['library(epiR)']
> File "C:\Python25\Lib\site-packages\rpy2\robjects\__init__.py", line 
> 503, in __getitem__
> res = rinterface.globalEnv.get(item)
> LookupError: 'library(epiR)' not found
> 
> Cheers
> Oliver
> 
> 
> Oliver Tomic  wrote on 07.01.2009 10:18:28:
> 
>  > Hi,
>  >
>  > I am sorry about this trivial question, but what is the obvious way
>  > to import a library in R in via rpy2?
>  >
>  > If I do the following in R:
>  >
>  > > library(epiR)
>  > Package epiR 0.9-14 is loaded
>  > Type help(epi.about) for summary information
>  > >
>  >
>  >
>  > What is the equivalent in rpy2?
>  >
>  >
>  > Windows XP
>  > Python 2.5
>  > rpy2 2.0.0
>  > R 2.8.0
>  >
>  > Thanks for you help!
>  >
>  > Cheers
>  > Oliver
>  > 
> --
>  > Check out the new SourceForge.net Marketplace.
>  > It is the best place to buy or sell services for
>  > just about anything Open Source.
>  > http://p.sf.net/sfu/Xq1LFB___
>  > 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 is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> 
> 
> 
> 
> ___
> 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 is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] load R-library via rpy2

2009-01-07 Thread Oliver Tomic

Thank you Laurent! This did it, now it works!

Cheers Oliver


Laurent Gautier  wrote on 07.01.2009 11:08:39:

> Hi Oliver,
>
> '(' is not '['.
>
> Check
>
http://rpy.sourceforge.net/rpy2/doc/html/introduction.html#calling-r-functions

> then
> http://rpy.sourceforge.net/rpy2/doc/html/robjects.html?
> highlight=evaluate#strings-as-r-code
> and eventually
> http://rpy.sourceforge.net/rpy2/doc/html/robjects.html?
> highlight=evaluate#r-the-instance-of-r
>
>
> L.
>
>
>
> Oliver Tomic wrote:
> > I forgot to mention that I tried the following with rpy2, but without
> > success:
> >
> >  >>> import rpy2.robjects as robjects
> >  >>> robjects.r['library(epiR)']
> >
> > Traceback (most recent call last):
> > File "", line 1, in 
> > robjects.r['library(epiR)']
> > File "C:\Python25\Lib\site-packages\rpy2\robjects\__init__.py", line
> > 503, in __getitem__
> > res = rinterface.globalEnv.get(item)
> > LookupError: 'library(epiR)' not found
> >
> > Cheers
> > Oliver
> >
> >
> > Oliver Tomic  wrote on 07.01.2009 10:18:28:
> >
> >  > Hi,
> >  >
> >  > I am sorry about this trivial question, but what is the obvious way
> >  > to import a library in R in via rpy2?
> >  >
> >  > If I do the following in R:
> >  >
> >  > > library(epiR)
> >  > Package epiR 0.9-14 is loaded
> >  > Type help(epi.about) for summary information
> >  > >
> >  >
> >  >
> >  > What is the equivalent in rpy2?
> >  >
> >  >
> >  > Windows XP
> >  > Python 2.5
> >  > rpy2 2.0.0
> >  > R 2.8.0
> >  >
> >  > Thanks for you help!
> >  >
> >  > Cheers
> >  > Oliver
> >  >
> >
>
--

> >  > Check out the new SourceForge.net Marketplace.
> >  > It is the best place to buy or sell services for
> >  > just about anything Open Source.
> >  >
http://p.sf.net/sfu/Xq1LFB___
> >  > 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 is the best place to buy or sell services for
> > just about anything Open Source.
> > http://p.sf.net/sfu/Xq1LFB
> >
> >
> >

> >
> > ___
> > 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 is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> ___
> 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 is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] calling R-functions

2009-01-07 Thread Oliver Tomic

Hi again,

I am reading the documentation but I must be missing something. When I try
this from the documentation everything works fine:

import rpy2.robjects as robjects
rsum = robjects.r['sum']
res = rsum(robjects.IntVector([1,2,3]))



Here, however I get an syntax error:


import rpy2.robjects as robjects
robjects.r('library(epiR)')
epiccc = robjects.r['epi.ccc']
tmp = epiccc(robjects.IntVector([1,2,3]), robjects.IntVector([1,2,3]), ci =
"z-transform", conf.level = 0.95)

SyntaxError: keyword can't be an expression


Here is the corresponding R-code that works:

library(epiR)
data <- read.table("C:/Work/PanelCheck/CONCORDANCE/Gele_FF_hardness.txt",
header=TRUE)
L1 <- data$B2
L2 <- data$B3
tmp <- epi.ccc(L1, L2, ci = "z-transform", conf.level = 0.95)


I guess this must be something trivial again, but just can't see where it
is going wrong.

Thanks for your help!

Cheers
Oliver


--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] calling R-functions

2009-01-07 Thread Laurent Gautier
Oliver Tomic wrote:
> Hi again,
> 
> I am reading the documentation but I must be missing something. When I 
> try this from the documentation everything works fine:
> 
> import rpy2.robjects as robjects
> rsum = robjects.r['sum']
> res = rsum(robjects.IntVector([1,2,3]))
> 
> 
> 
> Here, however I get an syntax error:
> 
> 
> import rpy2.robjects as robjects
> robjects.r('library(epiR)')
> epiccc = robjects.r['epi.ccc']
> tmp = epiccc(robjects.IntVector([1,2,3]), robjects.IntVector([1,2,3]), 
> ci = "z-transform", conf.level = 0.95)

conf.level means "the attribute 'level' in the object 'conf'".



> SyntaxError: keyword can't be an expression
> 
 >
> Here is the corresponding R-code that works:
> 
> library(epiR)
> data <- 
> read.table("C:/Work/PanelCheck/CONCORDANCE/Gele_FF_hardness.txt", 
> header=TRUE)
> L1 <- data$B2
> L2 <- data$B3
> tmp <- epi.ccc(L1, L2, ci = "z-transform", conf.level = 0.95)
> 
> 
> I guess this must be something trivial again, but just can't see where 
> it is going wrong.
> 
> Thanks for your help!
> 
> Cheers
> Oliver
> 
> 
> 
> 
> 
> 
> --
> Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> 
> 
> 
> 
> ___
> 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 is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] load R-library via rpy2

2009-01-07 Thread Anne Ghisla
Scrive Oliver Tomic :

> I forgot to mention that I tried the following with rpy2, but without
> success:
> 
> >>> import rpy2.robjects as robjects
> >>> robjects.r['library(epiR)']

Hello Oliver,

try this:
[code]
import rpy2.robjects as robjects
robjects.r.library("epiR")
[/code]

or, more like the code you wrote:

robjects.r['library']("epiR")

hope this helps,

cheers

Anne 


--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] calling R-functions

2009-01-07 Thread Oliver Tomic
Thanks again, Laurent and Anne!

This should have been obvious to me. I guess my brain doesn't function
propoerly today. Maybe it is time to go home.

Thanks again!

Cheers
Oliver


Laurent Gautier  wrote on 07.01.2009 14:34:19:

> Oliver Tomic wrote:
> > Hi again,
> >
> > I am reading the documentation but I must be missing something. When I
> > try this from the documentation everything works fine:
> >
> > import rpy2.robjects as robjects
> > rsum = robjects.r['sum']
> > res = rsum(robjects.IntVector([1,2,3]))
> >
> >
> >
> > Here, however I get an syntax error:
> >
> >
> > import rpy2.robjects as robjects
> > robjects.r('library(epiR)')
> > epiccc = robjects.r['epi.ccc']
> > tmp = epiccc(robjects.IntVector([1,2,3]), robjects.IntVector([1,2,3]),
> > ci = "z-transform", conf.level = 0.95)
>
> conf.level means "the attribute 'level' in the object 'conf'".
>
>
>
> > SyntaxError: keyword can't be an expression
> >
>  >
> > Here is the corresponding R-code that works:
> >
> > library(epiR)
> > data <-
> > read.table("C:/Work/PanelCheck/CONCORDANCE/Gele_FF_hardness.txt",
> > header=TRUE)
> > L1 <- data$B2
> > L2 <- data$B3
> > tmp <- epi.ccc(L1, L2, ci = "z-transform", conf.level = 0.95)
> >
> >
> > I guess this must be something trivial again, but just can't see where
> > it is going wrong.
> >
> > Thanks for your help!
> >
> > Cheers
> > Oliver
> >
> >
> >
> >
> >

> >
> >
>
--

> > Check out the new SourceForge.net Marketplace.
> > It is the best place to buy or sell services for
> > just about anything Open Source.
> > http://p.sf.net/sfu/Xq1LFB
> >
> >
> >

> >
> > ___
> > 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 is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB
> ___
> 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 is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] is rpy2 the default supported python module now

2009-01-07 Thread paul jobs
Hey guys
should i use rpy or rpy2
i m learning r language and rpy simultaneously

thanks a lot for pointers
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] is rpy2 the default supported python module now

2009-01-07 Thread paul jobs
http://www.bitbucket.org/lgautier/rpy2/
Where can i hg pull rpy2 ?
the above site is down

On 1/7/09, paul jobs  wrote:
>
> Hey guys
> should i use rpy or rpy2
> i m learning r language and rpy simultaneously
>
> thanks a lot for pointers
>
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


[Rpy] rpy on Windows

2009-01-07 Thread Alan G Isaac
I installed rpy using the most recent Windows installers.
Testing the installation produces 7 failures (not the 2
suggested in the documentation).  Access to robjects
does not match the documentation at:
http://rpy.sourceforge.net/rpy2/doc/html/introduction.html#the-r-instance

Example below.

Alan Isaac

Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import rpy2
 >>> rpy2.__version__
'2.0.0'
 >>> from rpy2 import robjects
 >>> robjects.r['pi']

 >>> print robjects.r['pi']
[1] 3.141593
 >>>

--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list


Re: [Rpy] rpy on Windows

2009-01-07 Thread Alan G Isaac
On 1/7/2009 5:13 PM Alan G Isaac apparently wrote:
> Access to robjects
> does not match the documentation

Badly put: I should have said that
*representation* of robjects does
not match the documentation.
(And is therefore much less useful.)

Alan Isaac


--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list