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.
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@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.