computeProximity: Compute Proximity Matrix

View source: R/cpp_functions.R

computeProximityR Documentation

Compute Proximity Matrix

Description

This function takes a numeric matrix and computes a square proximity matrix (similarity or distance) based on a specified method.

Usage

computeProximity(data, proxType, side, isContainMissingValue)

Arguments

data

A numeric matrix with n rows and p columns. Each row typically represents an observation.

proxType

An integer specifying the type of proximity measure to use.

side

An integer indicating the direction for computing proximity.

isContainMissingValue

An integer indicating whether the input data contains missing values.

Details

proxType

Available proxType options include:

  • 0: Euclidean

  • 1: Pearson correlation

  • 2: Kendall correlation

  • 3: Spearman correlation

  • 4: Adjusted tangent correlation (atancorr)

  • 5: City-block (Manhattan) distance

  • 6: Absolute Pearson correlation

  • 7: Uncentered correlation

  • 8: Absolute uncentered correlation

  • 20: Hamman similarity (binary)

  • 21: Jaccard index (binary)

  • 22: Phi coefficient (binary)

  • 23: Rao coefficient (binary)

  • 24: Rogers-Tanimoto similarity (binary)

  • 25: Simple matching coefficient (binary)

  • 26: Sneath coefficient (binary)

  • 27: Yule's Q (binary)

Ensure the data type matches the selected method. For example, binary methods should only be used on binary (0/1) data.

side

Use 0 for row-wise proximity and 1 for column-wise proximity.

isContainMissingValue

Set to 1 if the input data includes missing values; otherwise, use 0.

Value

A square matrix representing the proximity between rows or columns, depending on the selected side.


GAPR documentation built on June 8, 2025, 1:50 p.m.

Related to computeProximity in GAPR...