complementaryClusters: To check if two clusters are complementary

Description Usage Arguments Details Value Author(s) Examples

View source: R/complementaryClusters.R

Description

To check if two clusters include every element but without repeating anyone.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

LearnClust documentation built on Nov. 30, 2020, 1:09 a.m.