R: Forms the binary vector to mark the nodes with identical...

CalcMerge {ReorderCluster} | R Documentation

## Forms the binary vector to mark the nodes with identical class labels.

### Description

This is the auxiliary function of the package. It generates the binary vector to mark the nodes with identical class labels.

### Usage

    CalcMerge(hc,node,class)

### Arguments

`hc` | An object of class hclust which describes the tree produced by the clustering process.There are such components: merge, height, order, labels,call,method,dist.method.
`node` | a list of lists of length n-1 `testBar`, where each single list stores two vectors, consisting of elements of the left and right subtrees of the corresponding node in the merging matrix `hc`
`class` | a vector of length n, which stores the class labels of the dataset objects.

### Details

This is the auxiliary function of the package. It generates the binary vector to mark the nodes with identical class labels. The node or subtree with the elements, having the same class labela are marked by value 1, otherwise 0. The output vector is used as input to function `SubTree`, which simplifies the hierarchical tree in order to increase the efficiency of the dynamic programming algorithm.

### Value

`flag` | a binory vector of length n-1.

### Author(s)

Natalia Novoselova,Frank Klawonn,Junxi wang

Maintainer: Natalia Novoselova <novos65@mail.ru>

### References

Therese Biedl,Brona Brejova, Erik D,Demaine, Angele M.Hanmel and Tomas Vinar:Optimal Arrangement of Leaves in the Tree Representing Hierarchical Clustering of Gene Expression Data/Technical report 2001-14

### See Also

`RearrangeJoseph`, `OrderingJoseph`

### Examples

    data(leukemia)
    rownames(leukemia)=leukemia[,1]
    leukemia=leukemia[,-1]
    matr=leukemia[,-101]
    class=leukemia[,101]

    matr=as.matrix(matr)
    dist=dist(matr)
    hc <- hclust(dist)
    node=testBar(hc)
    flag=CalcMerge(hc,node,class)

[Package ReorderCluster version 2.0 Index]