dwinsemius at comcast.net
Tue Dec 2 05:57:48 CET 2008
> samp <- sample(pop, 2, replace=FALSE)
 14 9
> pop2<- pop[!pop %in% samp]
 1 5 7 12 18 19 65 54
On Dec 1, 2008, at 2:29 PM, Hamid Hamid wrote:
> Dear All,
> I am trying to build a program which will take repeated samples
> replacement from a population of values. The interesting catch is
> that I
> would like the sample values to be removed from the population,
> after each
> sample is taken.
> For example:
> sample(pop, 2) = lets say, (5,54)
> ## This is where I would like values (5, 54) to be removed from the
> population vector, giving a new "current" population vector:
> "new" pop = [1,14,7,9,12,18,19,65]
> and has length 8 instead of 10.
> In the cases when the size of pop and deriven sample of it is enough
> using the following command is not helpful.
> One could simplify my question in this way: how we can exclude a sub
> values from a super vector value (i.e sub vecor values are subset
> of super
> vector values).
> Thanks in advance.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help