[R] dendrogram stops!

Milan Bouchet-Valat nalimilan at club.fr
Wed Jan 16 09:15:11 CET 2013


Le mercredi 16 janvier 2013 à 07:29 +0200, Ibrahim Sobh a écrit :
> Dear  I am using the 'as.dendrogram' function from the 'stats' library
> to convert from an hclust object to a dendrogram with a dataset of
> size
>  ~30000 (an example code is below). I need the dendrogram structure to
>  use the "dendrapply" and "attributes" functions and to access the
> child
>  nodes, I do not need any of the plot properties.
Could you be more specific about what you want to do? Maybe you don't
need these functions because there are alternate ways of doing the same
thing with an hclust object.


Cheers

>  The problem is that it takes an infinite amount of time to convert
> and  it uses a lot of memory. Could you please let me know which part
> of the code (the link is below)
> 
>   takes the longest time and if there's a way to make it faster. Is it
> the
>   recursive part or when applying the attributes to each node
> (merging, etc) ?
>   If there isn't a way to make it faster, are there similar
> functions(dendrapply, attributes, accessing of child nodes) that use
> the
>   hclust object instead?
>  as.dendrogram code:
>  https://svn.r-project.org/R/trunk/src/library/stats/R/dendrogram.R
> 
> 
>  library('stats')
>  library('fastcluster')
>  options(expressions=500000)
>  NCols=10
>  NRows=30000
>  DataB <-matrix(runif(NCols*NRows), ncol=NCols)
>  HClust <- hclust.vector(DataB )
>  dhc<- as.dendrogram(HClust) #gets stuck here forever|
> 
> Best RegardsSobh 		 	   		  
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list