Re: [R] excluding factors from sampling

2010-11-30 Thread Mike Marchywka
: r-help@r-project.org > Subject: Re: [R] excluding factors from sampling > > You could just sample the complete group and then draw off the top the > number you want; the next time you go to the well, they are missing > and you get something from the remainder. You can also do 'setdiff

Re: [R] excluding factors from sampling

2010-11-30 Thread jim holtman
You could just sample the complete group and then draw off the top the number you want; the next time you go to the well, they are missing and you get something from the remainder. You can also do 'setdiff' to get the difference. On Tue, Nov 30, 2010 at 12:45 PM, Emma Moran wrote: > Hello, > > I

Re: [R] excluding factors from sampling

2010-11-30 Thread Adrienne Wootten
>From the way you describe it, I'd wager that you could probably use the sample function. For Example: > group = c("a","b","c","d","e","f","g","h","i","j") > sample(group,length(group),replace=FALSE) [1] "h" "j" "g" "f" "d" "i" "e" "b" "a" "c" but if you change replace to be TRUE > sample(gro

[R] excluding factors from sampling

2010-11-30 Thread Emma Moran
Hello, I am trying to write a function that first requires randomly sampling items from a set of factors. I need to be able to sample from that same set of factors, but exclude the ones that have already been sampled previously. For example, suppose I have a set of items a-j (a,b,c,d,e,f,g,h,i, an