Examples of generating permutations

library(iterpc)
  1. permutations: without replacement: distinct items
I <- iterpc(5, 2, ordered = TRUE)
getall(I)
  1. ermutations: with replacement: distinct items
I <- iterpc(5, 2, replace = TRUE, ordered = TRUE)
getall(I)
  1. permutations: without replacement: non distinct items
x <- c("a", "a", "b", "c")
I <- iterpc(table(x), 2, ordered = TRUE)
# or I <- iterpc(c(2,1,1), 2, label=c("a", "b", "c"), ordered = TRUE)
getall(I)
  1. permutations: with replacement: non distinct items
x <- c("a", "a", "b", "c")
I <- iterpc(table(x), 2, replace = TRUE, ordered = TRUE)
# or I = iterpc(c(2,1,1), 2, label=c("a", "b", "c"), replace= T RUE, ordered = TRUE)
getall(I)


Try the iterpc package in your browser

Any scripts or data that you put into this service are public.

iterpc documentation built on March 26, 2020, 7:29 p.m.