Skip to content
Prev 310565 / 398525 Next

biasing conditional sample

Can't you just use sample() on each row without replacement to guarantee no
matches among the five (or more) columns?

set.seed(51)
Data <- sapply(1:100, function(x) sample(1:10, size=5))
Data <- data.frame(t(Data))
names(Data) <- letters[1:5]

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352