On Sunday, December 11, 2011, Marko Limbek <marko.lim...@valicon.net> wrote:
> Apparently when Python composes output of a R method,
> results are transformed into dictionaries and some info is lost.
>
> For instance, I need four things from the result
> 1. names of var
> 2. coordinates of var
> 3. names of quali.sup
> 4. coordinates of quali.sup
>
> and in R everything is perfect, I have these two commands,
> each of which gives me names and coordinates
>
> 1. res.mca$var$coord
> 2. res.mca$quali.sup$coord
Yes, by default rpy v1 tries to convert everything into
Python objects and as you've found in some cases
this is loosy. See the documentation on this, it
is/was a FAQ. You can turn this off, or for example
access these precise terms in R syntax with the
evaluate an R string trick, something like this:
rpy.r("res.mac$var$coord")
> I instaled OrderedDict using easy_install as
> Thomas advised and it works, but I could
> use that only when building new dictionaries,
> I can't use that on the result, that is already
> structured by Python.
Yes, that is to be expected. You'd have to
modify rpy to use this new dictionary. It
wasn't part of standard Python when rpy
was written.
As I have suggested earlier, it might be
worth looking at rpy2 instead.
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