complementaryClusters {LearnClust} | R Documentation |
To check if two clusters are complementary
Description
To check if two clusters include every element but without repeating anyone.
Usage
complementaryClusters(components, cluster1, cluster2)
Arguments
components |
is an elements list. It contains every component that has to be in one cluster or in the other one. But each element can only be included in one cluster. |
cluster1 |
is a cluster (matrix). |
cluster2 |
is a cluster (matrix). |
Details
This function checks if the cluster that will be divided contains the simple elements that they have to include. They have to contain every element, but anyone should be duplicated.
The function will return a boolean value.
Value
Boolean value.
Author(s)
Roberto Alcántara roberto.alcantara@edu.uah.es
Juan José Cuadrado jjcg@uah.es
Universidad de Alcalá de Henares
Examples
data <- c(1,2,1,3,1,4,1,5)
components <- toListDivisive(data)
cluster1 <- matrix(c(1,2,1,3),ncol=2)
cluster2 <- matrix(c(1,4,1,5),ncol=2)
cluster3 <- matrix(c(1,6,1,7),ncol=2)
complementaryClusters(components,cluster1,cluster2) #TRUE
complementaryClusters(components,cluster3,cluster2) #FALSE
[Package LearnClust version 1.1 Index]