Skip to content

Instantly share code, notes, and snippets.

@Harshit1694
Created June 27, 2019 11:18
Show Gist options
  • Save Harshit1694/e7f45054499e015ff75034958ff7d40c to your computer and use it in GitHub Desktop.
Save Harshit1694/e7f45054499e015ff75034958ff7d40c to your computer and use it in GitHub Desktop.
#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