DistanceDistributions {BIDistances}R Documentation

Distance Distribution

Description

Calculates the distribution of the distances between the data points

Usage

DistanceDistributions(Data, DistanceMethods=c('bhjattacharyya', 'bray',
                                                       'canberra', 'chord',
                                                       'divergence', 'euclidean',
                                                       'minkowski', 'geodesic',
                                                       'hellinger', 'kullback',
                                                       'manhattan', 'maximum',
                                                       'soergel', 'wave',
                                                       'whittaker'),
                               CosineNonParallel = TRUE, CorrelationDist = TRUE,
                               Mahalanobis = FALSE, Podani = FALSE,
                               PlotIt = FALSE, PlotSampleSize = 5e3)

Arguments

Data

[1:n, 1:m] A matrix, containing data as rows.

DistanceMethods

Character vector stating all distance methods such as 'euclidean'.

CosineNonParallel

Boolean stating if cosine should be computed in parallel.

CorrelationDist

Boolean stating if CorrelationDist should be computed.

Mahalanobis

Boolean stating if Mahalanobis should be computed.

Podani

Boolean stating if Podani should be computed.

PlotIt

Boolean: TRUE => create plot. FALSE => no plot.

PlotSampleSize

Integer stating the number of samples for plotting.

Value

List with elements

DistanceMatrix

[1:n, 1:n] numeric matrix containing the distance matrix

DistanceChoice

[1:n, 1:n] numeric matrix containing the distance matrix

OrderedDistances

[1:n, 1:n] numeric matrix containing the distance matrix

ggobject

ggplot object

Author(s)

Michael Thrun

Examples

iris=datasets::iris
if(requireNamespace("DataVisualizations",quietly=TRUE)){
library(DataVisualizations)
DistanceDistributions(as.matrix(iris[,1:4]), c("euclidean"), PlotIt = FALSE)
}

[Package BIDistances version 0.1.3 Index]