Distance matrix in R
问题 I have to create a distance matrix using R. My data is in an Excel file which contains 300 rows and 10 columns. I have to create distance matrix based on the values of 9th column. For example s s s s s s 1 s 2 2 s 3 3 4 s 4 4 7 3 s 5 5 8 2 8 How to create this type of matrix? 回答1: Easiest option I know, is to save your Excel sheet containing the data as a CSV file. Make sure that only the first row and column of the sheet contain any sample or variable names. Then read into R using: dat <-