title: Create large correlation matrix with different correlation values
body: <p>I would like to create a correlation matrix for 50 variables where different variables have different correlations.</p>
  
  <p>In the perfect case when each variable has the same correlation I would use: </p>
  
  <pre><code>cor.table &lt;- matrix(rep(0.8,2500),50,50)
  diag(cor.table) &lt;- 1
  </code></pre>
  
  <p>However, now I would like to have for example 40 variables with correlation <code>.6</code> and the remaining 10 with correlation <code>-.2</code>.</p>
  
  <p>How can I set up such a table with the <code>matrix()</code> command?</p>
  
  <p>For example:</p>
  
  <pre><code>      1     2     3     4     5
  
  1     1   -0.2   0.6   0.6   0.6
  
  2   -0.2    1    0.6  -0.2   0.6
  
  3    0.6   0.6    1    0.6  -0.2
  
  4    0.6  -0.2   0.6    1    0.6
  
  5    0.6   0.6  -0.2   0.6    1
  </code></pre>