Hi I want to calculate the distance from center to each data points I have used the following codes but it's not working, df is my dataframe and c1 is center Thanks in advance
dist <- NULL
for(i in 1:nrow(df)) dist[i] <- euc.dist(df[i,],c1[i,])
dist
See Question&Answers more detail:os