title: In R, generate weighted sample with probability applied to multiple variables
body: <p>I have a matrix with several variables and a probability of occurrence for all the variables. I want to generate the weighted sample not for each vector independently but for all the variables (since there is correlation among them). </p>
  
  <pre><code>V1  V2  V3  prob
  30  40  40  0.4
  0   5   5   0.2
  15  20  30  0.4
  </code></pre>
  
  <p>I want to generate a matrix sample with V1, V2 and V3 that takes into account the simultaneous occurrence of certain values. </p>