Dear all, I am looking for a function in R which returns all possible permutations of an object x with r number of repitions. For example
If x <- c(0,1) and r <-3 the result should be 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 and consist of 2^3=8 elements. Unfortunately, I have found only functions which return the combinations for "choose n over k" but not the case described above. I would appreciate hints and help highly. Best, Martin -- ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.