R Interclass distance matrix
This question is sort of a follow-up to how to extract intragroup and intergroup distances from a distance matrix? in R . In that question, they first computed the distance matrix for all points, and then simply extracted the inter-class distance matrix. I have a situation where I'd like to bypass the initial computation and skip right to extraction, i.e. I want to directly compute the inter-class distance matrix. Drawing from the linked example, with tweaks, let's say I have some data in a dataframe called df : values<-c(0.002,0.3,0.4,0.005,0.6,0.2,0.001,0.002,0.3,0.01) class<-c("A","A","A",