title: Coding for two different clustering methods
body: <p>I used two different clustering methods to generate two clustering results and each cluster method contains 10 different groups. However, they are coded differently. The below example shows the clustering results:</p>
  
  <pre><code>set.seed(1)
  
  Df &lt;- data.frame(Var1 = sample(1:6, 100, replace =T), Var2 = sample(1:6,100, replace =T))
  
  table(Df)
  </code></pre>
  
  <p>I want to find the percentage agreement(or number of agreement) between these two methods and recode Cluster2 to levels of Cluster1 so that they will have the maximum percentage agreement (or number of cases). I wrote some algorithm to do it but was not very successful after the number of clusters increase. My dataset has over 100000 cases.   </p>