BrayCurtis: Kernels for count data

View source: R/kernel_functions.R

BrayCurtisR Documentation

Kernels for count data

Description

Ruzicka and Bray-Curtis are kernel functions for absolute or relative frequencies and count data. Both kernels have as input a matrix or data.frame with dimension NxD and N>1, D>1, containing strictly non-negative real numbers. Samples should be in the rows. Thus, when working with relative frequencies, 'rowSums(X)' should be 1 (or 100, or another arbitrary number) for all rows (samples) of the dataset.

Usage

BrayCurtis(X)

Ruzicka(X)

Arguments

X

Matrix or data.frame that contains absolute or relative frequencies.

Details

For more info about these measures, please check Details in ?vegan::vegdist(). Note that, in the vegan help page, "Ruzicka" corresponds to "quantitative Jaccard". 'BrayCurtis(X)' gives the same result than '1-vegan::vegdist(X,method="bray")', and the same with 'Ruzicka(data)' and '1-vegan::vegdist(data,method="jaccard")'.

Value

Kernel matrix (dimension: NxN).

Examples

data <- soil$abund
Kruz <- Ruzicka(data)
Kbray <- BrayCurtis(data)
Kruz[1:5,1:5]
Kbray[1:5,1:5]

kerntools documentation built on April 3, 2025, 7:52 p.m.