I'm trying to count the number of times I get four of a kind when drawing 5 cards from a deck. My code so far looks like this:
numbers2 <- c("Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King", "Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King", "Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King", "Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King", "Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King")
output <- matrix(ncol=5, nrow=10000)
for(i in 1:10000){
output[i,] <- sample(numbers2, 5, replace = FALSE)
}
df <- data.frame(output)
df <- data_frame(output)
At this point, I'm stuck, as I don't know how to count the rows in which 4 values are repeated. I didn't create an actual deck with suits because that way I don't have to deal with drawing a fifth same card if I do it with replacement.