title: Recording the Returned values return by sample function
body: <p>I need to create a throw function that returns a random number between 1 to 6 every time the user uses the throw() function. But i need to record the values that the user got in a variable that the user is not aware of. The idea is that i can cross verify the reported values and actual values at some later point of time.</p>
  
  <p>I went about it like this</p>
  
  <pre><code>throw&lt;-function(){
     dice&lt;-c(1:6)
      A&lt;-c(0,0)
         x&lt;-sample(dice,1)
          fetches&lt;-c(A,x)
            x
  }
  </code></pre>
  
  <p>I thought that calling the fetches variable would get me the required vector.But i am getting the output "object not found" while calling for fetches</p>
  
  <p>Thanks</p>