title: plotting chi-square results with corrplot raises matrix error
body: <p>I'm trying to visualize the results of chisq.test with the corrplot package and I'm getting an error I don't understand.  Hope someone can enlighten me.</p>
  <pre><code>library(corrplot)
  
  no &lt;- c(330, 470, 75, 400, 1050, 170, 90)
  yes &lt;- c(1700, 1000, 250, 2100, 500, 1250, 1200)
  df &lt;- data.frame(no, yes)
  
  #read in fn cor.mtest
  cor.mtest &lt;- function(mat, ...) {
    mat &lt;- as.matrix(mat)
    n &lt;- ncol(mat)
    p.mat&lt;- matrix(NA, n, n)
    diag(p.mat) &lt;- 0
    for (i in 1:(n - 1)) {
      for (j in (i + 1):n) {
        tmp &lt;- cor.test(mat[, i], mat[, j], ...)
        p.mat[i, j] &lt;- p.mat[j, i] &lt;- tmp$p.value
      }
    }
    colnames(p.mat) &lt;- rownames(p.mat) &lt;- colnames(mat)
    p.mat
  }
  
  p.mat &lt;- cor.mtest(df)
  
  chisq &lt;- chisq.test(df)
  M &lt;- as.matrix(chisq$residuals)
  corrplot(M, cl.pos = &quot;b&quot;, p.mat = p.mat, sig.level = 0.005, insig = &quot;blank&quot;)
  </code></pre>
  <p>the error is:</p>
  <pre><code>Error in corrplot(M, cl.pos = &quot;b&quot;, p.mat = p.mat, sig.level = 0.005, insig = &quot;blank&quot;) : 
  The matrix is not in [-1, 1]!
  </code></pre>
  <p>It does not seem to prevent the results plotting. I want to understand what it's trying to tell me here, but the documentation is not enlightening on this point. Can someone explain? Thanks.</p>