Learn R Programming

PLEXI (version 1.0.0)

distance: Function to calculate distance between two vectors

Description

Function to calculate distance between two vectors

Usage

distance(x, y, method = "cosine")

Value

the distance value

Arguments

x

numeric vector

y

numeric vector

method

distance calculation method: cosine (default), dot.prod, euclidian, manhattan, chebyshev, coassociation

Examples

Run this code
x = c(1,2,3)
y = c(6,4,6)
distance(x,y)

Run the code above in your browser using DataLab