title: How to create a dissimilarity matrix with daisy function in R?
body: <p>I want to perform a cluster analysis with the <code>pam</code> function in R, using <code>daisy</code> to create a dissimilarity matrix. My data contains 2 columns (ID and Disease). Both are factors with a lot of values (400 and 1800 respectively). How can I create the dissimilarity matrix I need to cluster the data using <code>pam</code>? </p>
  
  <p>Example data frame:</p>
  
  <pre><code>set.seed(1)
  df &lt;- data.frame(ID = rep(sample(c("a","b","c","d","e","f","g"),10,replace = TRUE),70),
                   disease = sample(c("flu","headache","pain","inflammation","depression","infection","chest pain"),100,replace = TRUE))
  
  df &lt;- unique(df)
  </code></pre>
  
  <p>Can I run the <code>daisy</code> function on this data frame or do I have to convert it into another format?</p>