Learn R Programming

AnimalSequences (version 0.2.0)

calculate_distance_matrix: Calculate Distance Matrix from Co-occurrence Matrix

Description

This function calculates a distance matrix from a given co-occurrence matrix.

Usage

calculate_distance_matrix(cooccurrence_matrix)

Value

A distance matrix computed from the normalized co-occurrence matrix.

Arguments

cooccurrence_matrix

A matrix representing the co-occurrence counts of elements.

Examples

Run this code
# Example usage:
cooccurrence_matrix <- matrix(c(3, 2, 1, 2, 5, 0, 1, 0, 4), nrow = 3, byrow = TRUE)
result <- calculate_distance_matrix(cooccurrence_matrix)
print(result)

Run the code above in your browser using DataLab