On Mon, Dec 12, 2011 at 3:18 PM, Marko Limbek <marko.lim...@valicon.net> wrote:
> Thank you Peter, but with me it doesn't work,
> as you can see from the printscreen in the attachment, that I send you.
> I followed all four steps.
> The warning in the picture says that variable resmca is not used.
>
> Marko

You had this:

set_default_mode(NO_CONVERSION)
nv = r.data_frame(...)
resmca = r.MAC(nv, ...)
set_default_mode(BASIC_CONVERSION)
c = r("resmca$var")

which gave an exception: object 'resmca' not found.

That is trying to tell you the object/variable 'resmca' does
not exist in R. And it doesn't because you created it in
Python instead. I think there is a way to assign variables
in rpy but the syntax escapes me right now. What you
can do (and it is NOT elegant) is just embed the R code
as a long string for rpy to execute:

set_default_mode(NO_CONVERSION)
r("""
nv <- data.frame(...)
resmca <- MAC(nv, ...)
""")
set_default_mode(BASIC_CONVERSION)
c = r("resmca$var")

However, backtracking for a moment, what went
wrong doing it the "proper" way though?
http://rpy.sourceforge.net/rpy/doc/rpy_html/R-objects-look-up.html#R-objects-look-up

Did you try this:

set_default_mode(NO_CONVERSION)
nv = r.data_frame(...)
resmca = r.MAC(nv, ...)
set_default_mode(BASIC_CONVERSION)
resmca.var__ #guess from memory

Also try:

print dir(resmca)

Peter

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to