You just need to calculate the average distance that each observation comes from its cluster. You already have these distances, so you just need to average them. Then the rest is a simple indexed division:
# calculate mean distances by cluster: m <- tapply(distances, kmeans.result$cluster,mean)
Your emissions:
> d[order(d, decreasing=TRUE)][1:5] 2 3 3 1 3 2.706694 2.485078 2.462511 2.388035 2.354807
source share