metricDistance: Calculate Generalized Minkowski Distance Between Two Vectors
Description
This function calculates the generalized Minkowski distance of order 'n' between two numeric vectors. This distance is a metric in a normed vector space which generalizes the Euclidean and Manhattan distances. It is used for various data science applications, particularly in clustering, optimization, and outlier detection in complex systems.
Usage
metricDistance(vec1, vec2, n)
Value
Numeric, the computed Minkowski distance between the two vectors.
Arguments
vec1
Numeric vector, the first vector for which the distance will be calculated.
vec2
Numeric vector, the second vector for which the distance will be calculated.
n
Integer, the order of the Minkowski distance. When n=2, it becomes the Euclidean distance; when n=1, it becomes the Manhattan distance.