distancematrix: Calculate categorical distance matrix for discrete data

distancematrixR Documentation

Calculate categorical distance matrix for discrete data

Description

Function invoking discrete distance functions. Available distances: 'bhattacharyya', 'chisquare', 'cramerV', 'hamming' and 'hellinger'

Usage

distancematrix(X, d)

Arguments

X

Matrix where rows are the observations and columns are discrete features

d

Name of distance. Distances available: bhattacharyya, chisquare, cramerV, hamming and hellinger

Value

R distance object

Examples

X = rbind(matrix(paste0("a", rpois(7*5, 1)), nrow=5),
          matrix(paste0("a", rpois(7*5, 3)), nrow=5))
distancematrix(X = X, d = "hellinger")

DiscreteGapStatistic documentation built on April 3, 2025, 9:22 p.m.