Right now my dataset is this and I am trying to compute a distance matrix in order to plot clusters. The Strings must be an exact match, I labeled the recipes A,B,C but they can be "Pizza", "Pasta", "Salad" etc and I need to create a cluster chart that displays the connection between the recipes but need the distance matrix first. Right now using this,
library(proxy)
mat = as.matrix(dist(data))
I obtain a 9x9 matrix, not a 3x3 as desired
How can I obtain a distance matrix just based on the recipes in common that connect the customers in order to plot and vice-versa?