title: correlation matrix of a bunch of categorical variables in R
body: <p>I have about 20 variables about different cities labeled "Y" or "N" and are factors. The variables are like "has co-op" and the such. I want to find some correlations and possibly use the corrplot package to display the connections between all these variables. But for some reason I cannot coerce the variables so that they are read in a way <code>corrplot</code> or even <code>cor()</code> likes so that I can get them in a matrix. I tried: </p>
  
  <pre><code> M &lt;- cor(model.matrix(~.-1,data=mydata[c(25:44)]))
  </code></pre>
  
  <p>but the results in corrplot came out really weird. Does anyone have a fast way to turn a bunch of Y/N answers into a correlation matrix? Thanks!</p>