Thanks David first. Probably, David misunderstood my points.
source vector = (1,2) the length of the target vector = 3 My expected "complete" outputs should be: 111, 112, 121, 122, 211, 212, 221, 222. sample(c(1,2),3,replace=TRUE) just gives me one "randomly sampled" combination at a time. However, I need the whole list displayed above at a time. Rui ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html