R: Enhanced Distance Matrix Computation and Visualization