I want to get a sample of some arbitrary size from a population having only two values 0 and 1 with replacement, but with different probability for selection. For example 0 will be selected with probability 0.4 and 1 with 0.6. I could use sample function i.e. sample(c(0,1), 30, T) to get this, however here, selection of either 0 or 1 has equal probability here. I am looking for a function which can do the same thing but with different probabilities.
       
---------------------------------
 Meet people who discuss and share your passions.  Join them now.
	[[alternative HTML version deleted]]

