Ricard Marxer wrote:
> Hi list,
> 
> I need some help in creating an R dendrogram from Python using RPy.
> 
>>From the R documentation [1] I get that a dendrogram object in R is just a 
> nested list with non-list elements being objects with at least the following 
> compulsory attributes:
>  - 'members'
>  - 'height'
>  - 'leaf'
> 
> I must admit that I'm completely new to R and RPy.  But by reading a bit the 
> RPy doc I tried the following naive conversion of the most simple dendrogram:
> 
> from rpy import *
> rdend = r.as_dendrogram({'members':1, 'height':0.5, 'leaf':True})
> 
> Could someone shed some light on how this should be done? and for a bit more 
> complex dendrograms?

Being new to R, trying to use it from python with RPy will be extra 
hard.  I would start by working only in R and getting the hang of 
working with dendrograms in R only.

Only then would I recommend trying it from python via RPy.  As you are 
dealing with a complex objects (dendrograms), you cannot simply convert 
them into python data structures - but for specific properties (e.g. 
branch lengths) turning them into a python structure makes sense (e.g. 
as a floating point number).

Peter


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to