title: Simulating correlated Bernoulli data
body: <p>I want to simulate 100 data with 5 columns. I want to get a correlation of 0.5 between the columns. To complete it, I have done the following action</p>
  
  <pre><code>F1 &lt;- matrix( c(1, .5, .5, .5,.5,
                     .5, 1, .5, .5,.5,
                     .5, .5, 1, .5,.5,
                     .5, .5, .5, 1,.5,
                     .5, .5, .5, .5,1
  ), 5,5)
  </code></pre>
  
  <p>To simulate the intended data frame, I have done this, but it does not work properly.</p>
  
  <pre><code> df2 &lt;- as.data.frame (rbinom(100, 1,.5),ncol(5), F1)
  </code></pre>