title: r generate random binary outcome with given probability
body: <p>I wish to generate random binary outcome with a given probability of 0.05.
  So in average I should get a positive (1) and 19 negatives (0) every 20 draws.</p>
  
  <p>How can I do that with R ?</p>
  
  <p>I see how I can generate with a 0.5 probability:</p>
  
  <pre><code>sample(0:1, 10000, replace=T)
  mean(sample(0:1, 10000, replace=T))
  [1] 0.5034
  </code></pre>
  
  <p>But I would need a probability of 0.05.</p>