Have such a data frame:
ID var 1 NA 2 NA 3 NA 4 NA ...
I need to randomly assign var values of 20% rows to be A, and 30% rows to be B, and 50% rows to be C.
var
Is there some efficient way to solve this?
Aucun commentaire:
Enregistrer un commentaire