title: sample n number of cards from a deck using rstudio
body: <pre><code>#initialize suits
  
  suits &lt;-c ("Heart", "Diamond", "Club", "Spade")
  cards &lt;-c ("Ace", "King", "Queen", "Jack", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten")
  deck &lt;- data.frame(suits = character(0), cards = character(0))
  
  numOfDeck = 1
  
  while (numOfDeck == 1){
        for (i in suits){
            for (j in cards){
                 deck &lt;- rbind.data.frame(deck, cbind.data.frame(j, i))
       }
     }
     numOfDeck = numOfDeck + 1
  }
  hand &lt;- sample (1:52, 5)
  </code></pre>
  
  <p>From this, I get the deck and five random numbers. I want to assign those random numbers to the rank in the deck such that: if i get 5 as my first random number, it should print Two Heart as that's what i have in position 5. How can I do that?</p>