[R] Sampling according to type

Suzen, Mehmet msuzen at gmail.com
Wed Mar 5 16:49:10 CET 2014


> myProbs[ which(ntype == 0)] <- 0.75/7 # Divide so the sum will be 1.0
> myProbs[ which(ntype == 1)] <- 0.25/3

Here of course you need to divide by number of 0s and 1s,  7 and 3
were was just an example.




More information about the R-help mailing list