correlationHC: To execute hierarchical correlation algorithm.

Description Usage Arguments Details Value Author(s) Examples

View source: R/correlationHC.R

Description

To execute hierarchical correlation algorithm applying weights, distance types, ...

Usage

1
2
3
4
5
6
7
8
correlationHC(
  data,
  target = NULL,
  weight = c(),
  distance = "EUC",
  normalize = TRUE,
  labels = NULL
)

Arguments

data

is a data frame with the main data.

target

is a data frame , a numeric vector or a matrix. Default value = NULL.

weight

is a numeric vector. Default value = empty vector.

distance

is a string. The distance type. Default value = Euclidean distance.

normalize

is a boolean parameter. If the user wants to normalize weights. Default value = TRUE.

labels

is a string vector. For the graphical solution. Default value = NULL.

Details

This function execute the complete hierarchical correlation method.

1 - The function transforms data in useful object to be used.

2 - It creates the clusters.

3 - It calculates the distance from the target to every cluster applying distance type given.

4 - It orders the distance in increasing way.

5 - It orders the clusters according to their distance from the previous step

6 - It shows the clusters sorted and the distance used.

Value

R object with a dendrogram, the sorted distances and the list with every cluster.

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
12
13
14
15
16
17
18
19
data <- matrix(c(1,2,1,4,5,1,8,2,9,6,3,5,8,5,4),ncol= 3)

dataFrame <- data.frame(data)

target1 <- c(1,2,3)

target2 <- dataFrame[1,]

weight1 <- c(1,6,3)

weight2 <- c(0.1,0.6,0.3)

correlationHC(dataFrame, target1)

correlationHC(dataFrame, target1, weight1)

correlationHC(dataFrame, target1, weight1, normalize = FALSE)

correlationHC(dataFrame, target1, weight2, 'CAN', FALSE)

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