Hi there! I can't find any information about creating combinations with repetitions in R. The function combn() does create combinations, but _without_ repetitions.
   Here is what I need to do:

svIter <- 1000
xx <- matrix(rnorm(m*n), c(m, n))
sequence <- seq(range(xx)[1], range(xx)[2], length.out = svIter^(1/q))
expand.grid(secuence, secuence, .../q times/..., secuence)

That is, I need a grid which covers a q-dimensional space with range range(xx) for each dimension, and a total number of points close to svIter. My problem could be solved by writting the expand.grid call at runtime, but I think that is not very elegant and, overall, I don't know how to do that. If combn() accepted repetitions, it'd be solved also.
   Any help will be greatly appreciated.
   Bests,

--                                                      --
Jose Luis Aznarte M.       http://decsai.ugr.es/~jlaznarte
Department of Computer Science and Artificial Intelligence
Universidad de Granada           Tel. +34 - 958 - 24 04 67
GRANADA (Spain)                  Fax: +34 - 958 - 24 00 79

______________________________________________
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.

Reply via email to