I was trying sample(), however whenever I used custom probability in it ,it constantly displays "incorrect number of probabilities"
I've tried pretty much everything but still stuck. Kindly guide me as to what I am doing wrong..
Code:
sample(10:50,4,replace = T,prob = c(.1,.2,.3,.4))
Error in sample.int(length(x), size, replace, prob) :
incorrect number of probabilities