https://github.com/cran/pracma
Raw File
Tip revision: 26e049d70b4a1c237987e260cba68f6a9413736c authored by Hans W. Borchers on 09 April 2019, 04:10:07 UTC
version 2.2.5
Tip revision: 26e049d
combs.R
##
##  c o m b s . R  Test Suite
##

combs <- pracma::combs
randcomb <- pracma::randcomb

identical(combs(2, 1), 2)
identical(combs(c(1, 2, 3), 2), matrix(rep(c(1, 2, 3), each = 2), 3, 2))
identical(nrow(combs(1:6, 4)), 15L)

all(c(1,2,3) %in% randcomb(c(1,2,3), 3))
back to top