View source: R/cpp_functions.R
computeProximity | R Documentation |
This function takes a numeric matrix and computes a square proximity matrix (similarity or distance) based on a specified method.
computeProximity(data, proxType, side, isContainMissingValue)
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. |
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
.
A square matrix representing the proximity between rows or columns, depending on the selected side.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.