title: Write a function that throw repeatedly a dice until N sixes have been thrown
body: <p>I have tried this but i know it only notifies me when I get one 6 but not N sixes but I have no idea what to write to get N sixes. Then in the exercise they ask  Write the main program that calls the function, say, 100 times for different values of N and plots the
  average number of times the dice had to be thrown as a function of N.</p>
  <pre><code>two.dice1.1 &lt;- function(){
  
    nthrows=1
  
    while ((sample(1:6, size =1 , replace = TRUE))&lt;6) {
  
      nthrows=nthrows+1
    } 
  
    return(nthrows)
  }
  </code></pre>