title: How do I simulate a poker hand dealing in R?
body: <p>I play an online poker game, and I am concerned that the initial hands dealt to the player are not random after what seems to me after many observations too many non-random distributions. I'm trying to take 200-1000 hands dealt and compare it to a simulation to compare the distributions and see if it is indeed random. If it is, I would expect a uniform distribution. Anyways, I'm having a hard time figuring out how to store an array of 1,000 deals with two cards to each hand. Below is the code I have but every output prints out the same "2C and KC", 1000 times. Replace needs to equal false, since identical cards can't be dealt. I'd appreciate any help with solving this simulation, as well as any advice anyone may have as to going about this experiment. Thanks in advance!</p>
  
  <pre><code>cardDeck &lt;- c("AH", "1H", "2H", "3H", "4H", "5H", "6H", "7H", "8H", "9H", "10H", "JH", "QH", "KH",
                "AS", "1S", "2S", "3S", "4S", "5S", "6S", "7S", "8S", "9S", "10S", "JS", "QS", "KS",
                "AC", "1C", "2C", "3C", "4C", "5C", "6C", "7C", "8C", "9C", "10C", "JC", "QC", "KC",
                "AD", "1D", "2D", "3D", "4D", "5D", "6D", "7D", "8D", "9D", "10D", "JD", "QD", "KD")
  
  deal &lt;- function(cardDeck) {
    cardOne &lt;- sample(cardDeck, 1, replace = FALSE)
    cardTwo &lt;- sample(cardDeck, 1, replace = FALSE)
    handDealt &lt;- paste(cardOne, cardTwo, sep = " and ")
  }
  
  cardsDealt &lt;- rep(deal(cardDeck), 1000)
  </code></pre>