Skip to content
Prev 34018 / 398513 Next

sample from a list of names for random groups

> n2 <- 3
 > (S <- sample(letters, n1+n2))
[1] "f" "a" "d" "n" "l"
 > (S1 <- sample(S, n1))
[1] "l" "n"
 > (S2 <- S[!is.element(S, S1)])
[1] "f" "a" "d"
 >
hope this helps.  spencer graves
Daniele Medri wrote: