calcDistance {bingat} | R Documentation |
Calculate the Distance Between Vectors
Description
This function calculates the distance between two vectors.
Usage
calcDistance(x, y, type = "", method = "hamming")
Arguments
x , y |
Vectors of the same length that contain 1's and 0's. |
type |
The type of graph being used (adjmatrix or adjmatrixlt). See 'Details' |
method |
The distance metric to use, currently only "hamming" is supported. |
Details
If the type = "adjMatrix"
is used, the value will be divided by 2 to account for duplicate comparisons.
Otherwise the type
does not affect the output.
Value
A single number indicating the distance between the two input vectors.
Author(s)
Terrence Brooks, Berkley Shands, Skye Buckner-Petty, Patricio S. La Rosa, Elena Deych, William D. Shannon
Examples
data(braingraphs)
dist <- calcDistance(braingraphs[,1], braingraphs[,2], "adjMatrix")
dist
[Package bingat version 1.3 Index]