mardi 27 janvier 2015

random function with a same probability for each value in R

is there any built in function in R, which I could use to generate a random value between the value I choose for with the same probability for example I have a vector which I want to assign 1 or 0 with 50% probability to each value. is there any function which I could say what are my values and according to that the probabilities in other words: values(A,B,C,F), with a 0.25 probability for each and then assign that random value to each vector value. thanks in advance,





Aucun commentaire:

Enregistrer un commentaire