vendredi 7 août 2015

In R: how to simulate the season of an NBA team?

I basically want to create a vector which length is 82. This should contain either "W" or "L", but their occurrences should be randomly determined. I tried with this season<-rep(c("W","L"), times = 1, length.out = 82, each = 1) but I only get this: [1] "W" "L" "W" "L" "W" "L"... Trivial question but I am a newbie to R. Thanks!




Aucun commentaire:

Enregistrer un commentaire