Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#Calculating the euclidean distance
ED<-function(data1,data2){
distance=0
for (i in (1:(length(data1)-1))){
distance=distance+(data1[i]-data2[i])^2
}
return(sqrt(distance))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.