https://github.com/cran/pracma
Raw File
Tip revision: 3fdb68cc842f2ab3b59608f8e04d495763584f78 authored by Hans W. Borchers on 27 November 2015, 12:07:10 UTC
version 1.8.8
Tip revision: 3fdb68c
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