https://github.com/cran/pracma
Tip revision: 7e2814c76ec9bc4503af661775ea73f11ec16537 authored by Hans W. Borchers on 15 November 2014, 00:00:00 UTC
version 1.7.9
version 1.7.9
Tip revision: 7e2814c
perms.R
##
## p e r m s . R Test Suite
##
perms <- pracma::perms
randperm <- pracma::randperm
identical(perms(2), matrix(2, 1, 1))
identical(perms(c(1, 2)), matrix(c(2, 1, 1, 2), 2, 2))
identical(nrow(perms(1:6)), 720L)
all(c(1,2,3) %in% randperm(c(1,2,3)))