Learn R Programming

GDAtools (version 2.1)

dist.chi2: Chi-squared distance

Description

Computes the chi-squared distance between the rows of a data frame of factors.

Usage

dist.chi2(X)

Value

A symmetrical matrix of distances

Arguments

X

data frame. All variables should be factors.

Author

Nicolas Robette

Details

This function is adapted from chi2Dist function in ExPosition package.

Examples

Run this code
data(Music)
d <- dist.chi2(Music[,1:5])
# a short piece of the distance matrix
d[1:3, 1:3]

Run the code above in your browser using DataLab