This data.frame contains the dissimilarity y between two communities comm1 and comm2. I would like to convert it to a dissimilarity matrix of type dist.
library(tidyverse)
library(RcppAlgos)
k<-10
comm_code<-seq(1,k,by=1)
data<-comboGrid(comm_code,comm_code, repetition = F)
data<-data.frame(data)
data<- data %>% rename(comm1=Var1,comm2=Var2)
rm(comm_code,k)
data$y<-rnorm(nrow(data),10,2)
How can I do this?
Thanks