Can I use table() to calculate?

bingo <-c(16,11,24,26,15,18)
my <- NULL
check <- NULL
i <- 1
for (i in 1:200) {
tmp1 <- sample(x =1:49, size = 6, replace = F)
tmp2 <- sum(tmp1 %in% bingo)
check <- c(check,tmp2)
tmp3 <- paste0(tmp1, collapse = ",")
res <- paste0("(", tmp3, ")")
my <- c(my, res)

After writing the code I mentioned above,I want to sort the check in 200 groups into four groups
then if three number in each group are the same with (16,11,24,26,15,18),I get1000$
if four number ,I get 10000$
if five number ,I get 100000$
if six number,I get 1000000$
so, Can I use table() to calculate, and how to use?

Did you find this solution unsatisfactory?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.