> n1 <- 2
> 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:
Dear R-users,

I need to sample from a list of names (people) and create 2 random groups with unique item. Sure sample() function is a good point to start but I can't find example to solve my work.

any tips? example?

Thank

______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to