title: generate random integers between two values with a given probability using R
body: <p>I have the following four number sets: </p>
  
  <pre><code>A=[1,207];
  B=[208,386];
  C=[387,486];
  D=[487,586].
  </code></pre>
  
  <p>I need to generate 20000 random numbers between 1 and 586 in which the probability that the generated number belongs to A is 1/2 and to B,C,D is 1/6.</p>
  
  <p>in which way I can do this using R?</p>