close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Ticket #1400: ClusterUtils.r

File ClusterUtils.r, 491 bytes (added by Jorge, 13 years ago)
Line 
1require(cluster)
2
3Hclust.TOL <- function( dist.bbm, args.R )
4  {
5    # print( "running Hclust.TOL" );
6    dist <- as.dist( read.bbm( dist.bbm ) )
7    # Eval non-binary arguments
8    source( args.R, local=TRUE )
9    m = Hclust_args$method
10    size = Hclust_args$size
11    hclustResult <- hclust( dist, m );
12    groups = cutree( hclustResult, k = size )
13    # Write the result
14    # print( paste( "writing '", Hclust_args$result.bbm, "'" ) )
15    write.bbm( Hclust_args$result.bbm, groups )
16  }