distances: To calculate distances applying weights.

Description Usage Arguments Details Value Author(s) Examples

View source: R/distances.R

Description

To calculate distances between two clusters applying weights depending on the distance type.

Usage

1
distances(cluster1, cluster2, distance, weight)

Arguments

cluster1

is a matrix.

cluster2

is a matrix.

distance

is a string. The distance type to apply.

weight

is a numeric vector.

Details

This function calculates distance applying distance type and applying each weight to its characteristic.

Distance type could be EUC, MAN, CAN, CHE or OCT.

Value

Distance value applying weights.

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
cluster1 <- matrix(c(2,3))
cluster2 <- matrix(c(4,5))

weight1 <- c(0.6,0.4)
weight2 <- c(2,4)

distances(cluster1, cluster2, 'MAN', weight1)

distances(cluster1, cluster2, 'CHE', weight2)

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