> 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.