# NOT RUN {
# choose 2 from 4
combinations(4, 2)
combinations(x = LETTERS[1:3], k = 2)
# multiset with frequencies c(2, 3)
combinations(freq = c(2, 3), k = 3)
# with replacement
combinations(4, 2, replace = TRUE)
# column major
combinations(4, 2, type = "c")
# list output
combinations(4, 2, type = "l")
# zero sized combinations
dim(combinations(5, 0))
dim(combinations(5, 6))
dim(combinations(0, 0))
dim(combinations(0, 1))
# }
Run the code above in your browser using DataLab